Author Archives: amolujagare

Byamolujagare

Interview questions | capgemini | Telephonic

Selenium Interview questions | capgemini

capgeminie

1.explain your project and role

Briefly explain the functionality of your project and your role as tester. what part you have tested what things were manual where you used automation and why.

2. explain your framework/how do you maintain tests

Most of the times the page object model is used for the implementation. so you can tell them that ,

  1. we had object repository different . there was a different class for different page in certain package. that class contains WebElements and Methods.
  2. for test there was another package. each class belongs to a particular page where there are all tests present related to that page
  3. we used to run the tests using testNG.xml.
  4. the input data we have kept in an excel sheet and we used poi library t extract it with data providers.
3.what are disadvantages of page object model

Page Objects Model is best suited for applications which have multiple pages or states. Each of which have fields which can be uniquely referenced with respect to the page.

Advantages:

  1. Object Repository: You can create an Object Repository of the fields segmented page-wise. This as a result provides a Page Repository of the application as well. Each page will be defined as a java class. All the fields in the page will be defined in an interface as members. The class will then implement the interface.
  2. Functional Encapsulation: All possible functionality or operations that can be performed on a page can be defined and contained within the same class created for each page. This allows for clear definition and scope of each page’s functionality.
  3. Low maintenance: Any User Interface changes can swiftly be implemented into the interface as well as class.
  4. Programmer Friendly: Robust and more readable. The Object-oriented approach makes the framework programmer friendly.
  5. Low Redundancy: Helps reduce duplication of code. If the architecture is correctly and sufficiently defined, the POM gets more done in less code.
  6. Efficient & Scalable: Faster than other keyword-driven/data-driven approaches where Excel sheets are to be read/written.

Disadvantages

  1. High Setup Time & Effort: Initial effort investment in development of Automation Framework is high. This is the biggest weight of POM in case of web applications with hundreds/thousands of pages. It is highly suggested that if this model is decided to be implemented, then it should be done parallel to development of the application. Refer V-Model for Software Development Life Cycle.
  2. Skilled labor: Testers not technically sound or aware of programming best practices are a nightmare in this case. Perhaps this is the biggest mistake to make, employing unskilled labor in hopes of training them during implementation. Unskilled testers need to undergo a Training Boot Camp to be ready for such an undertaking. Also the Architecture of the framework should be defined clearly and completely before development in order to avoid any loopholes in later stages. Every application is different and it may require the automation framework to be significantly tailored towards it.
  3. Specific: Not a generic model. Automation Framework developed using POM approach is specific to the application. Unlike keyword-driven/data-driven frameworks, it is not a generic framework.

Irrespective of the disadvantages, POM is perhaps the most efficient and highly recommended approach towards any web application. As the framework matures it is perhaps easier to modify it into a hybrid framework from a POM approach than from other keyword/data driven approaches

Courtesy Stackoverflow Thread

5. Overloading and overriding

Method Overloading Method Overriding
1) Method overloading is used to increase the readability of the program. Method overriding is used to provide the specific implementation of the method that is already provided by its super class.
2) Method overloading is performed within class. Method overriding occurs in inherited classes.
3) M overloading can’t be performed by changing return type of the method only. Return type can be same or different in method overloading. But we must have to change the parameter. Return type must be same in method overriding.
4) It is the example of compile time polymorphism. It is the example of run time polymorphism.
5) In case of method overloading, signatures must be different. In case of method overriding, signatures must be same.

6.static key word

When a variable is declared with the keyword “static”, its called a “class variable”. All instances share the same copy of the variable. A class variable can be accessed directly with the class, without the need to create a instance.

A method is declared as static when it doesn’t change the state of an object. and it has all the static variables only.

7.string reverse [using charAt()]

Ans : Below is the logic

String Str="MyString";
int length = str.length();
for ( int i = length - 1 ; i >= 0 ; i-- )
reverse = reverse + str.charAt(i);
System.out.println("Reverse of entered string is: "+reverse);
8. test plan.

Test plan is the most important activity to ensure that there is initially a list of tasks and milestones in a baseline plan to track the progress of the project. It also defines the size of the test effort.It is the main document often called as master test plan or a project test plan and usually developed during the early phase of the project.

Below are the items of test plan template.

  • Test plan identifier
  • Introduction
  • Test items
  • Features to be tested
  • Features not to be tested
  • Approach
  • Item pass/fail criteria
  • Suspension criteria and resumption requirements
  • Test deliverables
  • Testing tasks
  • Environmental needs
  • Responsibilities
  • Staffing and training needs
  • Schedule
  • Risks and contingencies
  • Approvals
9. Test case objective and test strategy
Test case objective
Test case objective is nothing but. a description of the purpose of the test.
for e.g. if we want to test a functionality of a save button we will write objective as ,” To test the functionality of save button.”
Test strategy
  • A Test Strategy document is a high level document and normally developed by project manager. This document defines “Software Testing Approach” to achieve testing objectives. The Test Strategy is normally derived from the Business Requirement Specification document.
  • The Test Strategy document is a static document meaning that it is not updated too often. It sets the standards for testing processes and activities and other documents such as the Test Plan draws its contents from those standards set in the Test Strategy Document.
  • Some companies include the “Test Approach” or “Strategy” inside the Test Plan, which is fine and it is usually the case for small projects. However, for larger projects, there is one Test Strategy document and different number of Test Plans for each phase or level of testing.
10.throw & throws

Throw keyword is used to explicitly throw an exception.

e.g. throw new IOException(“This is not a valid class”);

throws keyword is used to declare an exception.

e.g. void myMethod()throws IOException {

//method code

}

11.Abstraction and encapsulation
  • Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. Encapsulation is implemented using private, package-private and protected access modifier.

  • Abstraction is the concept of hiding irrelevant details.In other words make complex system simple by hiding the unnecessary detail from the user.Abstraction is implemented in Java using interface and abstract class.

Byamolujagare

Interview questions @ Infosys

  1. Explain your project and role.
  2. What was your directory structure of your framework
  3. Where do you keep object repository
  4. How do you define WebElement.
  5. Web Element is class or interface
  6. How do you write java program to add 2 no.’s
  7. How do you access a function in a java program
  8. How do you define object in a class
  9. What are different components of selenium.
  10. What is your approach when you get build to test.How do you proceed.
  11. All things are not possible to test using selenium,What are those?
  12. what is regression.
  13. What is a test plan/ What is a test plan template.
  14. What is a test bed

SQL :- write a query to find out second highest salary of an employee and its name

Ans: select name,max(salary) from employee where sal < (select max(sal) from employee)

Byamolujagare

Advantages of selenium

1. Selenium is pure open source, freeware and portable tool.
2. Selenium supports variety of languages that include Java, Perl, Python, C#, Ruby, Groovy, Java Script, and VB Script. etc.
3. Selenium supports many operating systems like Windows, Macintosh, Linux, Unix etc.
4. Selenium supports many browsers like Internet explorer, Chrome, Firefox, Opera, Safari etc.
5. Selenium can be integrated with ANT or Maven kind of framework for source code compilation.
6. Selenium can be integrated with TestNG testing framework for testing our applications and generating reports.
7. Selenium can be integrated with Jenkins or Hudson for continuous integration.
8. Selenium can be integrated with other open source tools for supporting other features.
9. Selenium can be used for Android, IPhone, Blackberry etc. based application testing.
10. Selenium supports very less CPU and RAM consumption for script execution.
11. Selenium comes with different component to provide support to its parent which is Selenium IDE, Selenium Grid and Selenium Remote Control (RC).