Showing posts with label selenium interview questions and answers. Show all posts
Showing posts with label selenium interview questions and answers. Show all posts

21. : Which android version is supported by appium?
Answer : Appium support Android 17+ API level versions only. You need to use selendroid if you have older version of android API level. View MORE DETAILS.

22. : How to configure appium project in eclipse?
Answer : Appium project configuration steps are given on THIS PAGE.

16. : Can you tell me few appium limitations?
Answer : Limitations Of Appium are described on THIS PAGE.

17. : Tell me different ways to locate android app elements in appium automation.
Answer : You can locate android app's elements using bellow given different ways.
  1. XPath
  2. ID
  3. Name
  4. className
  5. AccessibilityId
18. : Can you tell me different ways to locate element by XPath?
Answer : You can create XPath in different ways to locate same element. Different XPath examples are given on THIS PAGE.

11. : How to configure android device to run software test using appium in devices?
Answer : In order to run software automation tests using appium in android device, You need to enable USB debugging in your android device. VIEW DETAILS on how to enable USB debugging in android device.

12. : Tell me the command name for windows to verify that android device is connected with PC.
Answer : You can run adb devices command in windows to make sure that device is connected properly with PC to run appium tests on it.

6. : What is Node.js?
Answer : It is cross-platform runtime environment which is used to develop server-side software web applications. It is open-source so you can use it without any cost.

7. : What is Desired Capabilities and how it is used in Appium software testing tool?
Answer : Desired Capabilities is bunch of keys and it's value. Using this set of keys and values we can tell to appium server that what kind of automation session we are going to create. Example : If you set platformName = Android then appium will understand that you wants to create automation session to run test on Android.

1. : What Is Appium?
Answer : Appium is an open source mobile application automation testing tool. Using appium, We can automate native applications, Mobile web applications and mobile hybrid applications on Android and IOS platforms. VIEW MORE DETAIL

2. : What are the prerequisites to install appium in windows?
Answer : You need to install few software before install and use appium in windows. Bellow given software are required to install appium in windows.

Part 10

46 : What is Polymorphism?
Answer : Polymorphism is ability using which we can create reference variables or methods which behaves differently in different programmatic context. Best example of polymorphism is human. We behaves differently with different people in different environment. Our behavior will be different when we meet to boss and meet to friend. Read more on Polymorphism in java.

47 : What is the advantages of Polymorphism?
Answer : Main advantage of polymorphism is code reusabilty. You can dynamically supply different implementations through polymorphism. So it will reduce your work volume in terms of handling and distinguishing various objects.

Part 9

41 : In java, What is return type of main method?
Answer : Main method doesn't have any return type. It is void.

42 : Can We Overload main method in java?
Answer : Yes, Java class can have any number of main methods so it is possible to overload main method. But when you run program, It will not execute overloaded main method. Always It will execute only public static void main(String[] args) method.

Part 8

36 : What is the difference between the Constructor and Method?
Answer : Main difference between the Constructor and Method is as bellow.

Constructor :
  1. Name of the constructor must be same as class name.
  2. Constructor must not have any return type.
  3. It is used to initialize the state of an object.
  4. It is not possible to call constructor directly. Constructors called implicitly when the new keyword creates an object.
Method :
  1. Method name can be any.
  2. Method must have return type.
  3. It is used to expose behavior of an object.
  4. Methods can be called directly.
Read more on Constructor and Method.

Part 7

31 : What is default value of local variable.
Answer : There is not any default value of local variable. You must have to initialize it. View more details on local variables in java.

32 : Java support constructor inheritance?
Answer : No, Constructor inheritance is not supported in java. View more details on constructor in java.

Part 6

26 : What is local variable in java?
Answer : Local variable is declared inside method or constructor and it is limited for that method or constructor only. View more detail on local variable in java.

Local Variable Example :
public class JavaVariable {

 public void Calc() {
  // Local Variables.
  int sum;
  int item1 = 5;
  int item2 = 7;
  sum = item1 + item2;
  System.out.println("Sum is : " + sum);

 public static void main(String args[]) {
  JavaVariable j = new JavaVariable();

Earlier we have talked about method overriding concept in java during THIS POST to change the implementation of parent class's method in sub class. In inheritance, Super keyword is used to refer object of immediate parent class. Generally we are using super keyword in inheritance for three different purpose. Let's see how and when to use super keyword in java. Interviewer can ask you this question so please understand how it works.

Part 5

21 : Explain System.out.println();

Answer :
  • System : is a final class in  java.lang package.
  • out : is a static member of system class. It is an instance of This stream is already open and ready to accept output data.
  • println : is a method of .It is an overloaded method.

Part 4

16 : Can we overload static methods? 

Answer : Yes.. There is not any restriction to overload static methods. We can overload static and non static methods in java. VIEW MORE on overloading in java.

Part 3

11 : Why main method is static?

Answer : As we know, We can access static stuff without creating object of class. Because of static keyword with main method, Java virtual machine can directly call it without creating object of class. This way it will provide kind of root to start execution of program.

12 : What is method overloading?

Answer : Method overloading is ability to create multiple methods with same in same class but with different signatures (different input parameters and types). Method names will be same but parameters will be different for all overloaded methods.

Part 2

6 : What is the difference between static and not static variable?

Answer : Main differences are as bellow.
  • Static variables are preceded by static keyword. For non-static variable, there is not any preceding keyword.
  • Memory is allocated for static variables at the time of class loading. Memory is allocated to non- static variables whenever an object is created.
  • Memory is allocated only once to static variables on class loading. Memory is allocated multiple time whenever a new object is created to non-static variables.
  • Static variable example : Collage name of students, Company name of employees..
READ MORE about static and non-static stuff.

7 : What is the difference between static and not static(Instance) method?

Answer : Difference between static and non static method is as bellow.
  • Method declared with static keyword is static method. If Method declared without static keyword then it is instance method.
  • No need of object to call static methods. Object needed to call instance method.
  • Can not access non static stuff inside static methods directly. Opposite to it, We can access static and non static stuff directly inside instance method.
READ MORE detail on static and non-static stuff.


1 : What is object in java?

Answer : Object Is an Instance of class and it has its own state and behavior. In real world we can say, Dog is object of Animal class which have different state like breed, color, name, hungry, etc and behavior  like wagging tail, fetching, barking etc.

2 : What is class?

Answer : A class is the blueprint or we can say template from which individual objects are created.

Part 23

108 : I wants to pass parameter In software test case through testng.xml file. How can I do It?

Answer : You can use <parameter> node under <test> node In testng.xml file with parameter name and value. Then you can use @Parameters annotation with parameter name In your test case of software web application. VIEW USAGE OF @PARAMETER ANNOTATION.

Part 20

93 : Tell me the class name using which we can generate Action chain.

Answer : The WebDriver class name Using which we can generate Action chain Is "Actions". VIEW USAGE OF ACTIONS CLASS with practical example on how to generate series of actions to drag and drop element of software web application.

Part 19

88 : In XPath, I wants to do partial match on attribute value from beginning. Tell me two functions using which I can do It.

Answer : We can use bellow given two functions with XPath to find element for software web page using attribute value from beginning.
  1. contains()
  2. starts-with()

Part 18

83 : What are the benefits of parallelism over normal execution?

Answer : Using parallelism facility of TestNG In selenium webdriver,
  • Your software test execution time will be reduced as multiple tests will be executed simultaneously.
  • Using parallelism, We can verify multithreaded code In software application.