SELENIUM INTERVIEW QUESTIONS AND ANSWERS


What is the difference between close and quit method.

Close method is use to close the current window on which the focus is current present.
Quite method is use to close all the windows open by web-driver.

Explain type of XPATHS in selenium.

In selenium we can have two type of xpath i.e.

  1. Complete or Absolute xpath.
  2. Partial XPATH.


What is the difference between implicit wait and explicit wait.

What is the difference between assert and verify.




how to switch from frame to main window tel syntax.
what is difference between pom and pagefactory?
where does automation fit into testing flow?
what are challenges that you faced while automating testcases?
scenario: there is a submit button in page it has id property.
by using id we got element not found expection, how will you
handle dis situation. what might be the problem in dis case.
scenario: if submit button contain in one of 3 frames in page, how will you handle this.
if element is loaded by taking much time how to handle dis situation in selenium.
what is the problem with thread.sleep in code?
what is the concept of selenium grid?

when we execute testcases in grid where results will be stored in node or hub?
 11> difference b/w quit and close.
 12> scenario: manually u opened a firefox browser window with gmail login, now with selenium you opened
 a firefox browser window with facebook login. what happens when we use quit method?
 will it closes all windows including gmail one?
 13> what all annotations used in testng in ur project?
 14> if we wanna do datadriven with testng what are all annotations required?
 15> is it possible to pass test data through testng.xml file, if yes how?
 16> how to run specific kind of testcases using testng?
 17> how to prioritize test cases in testng?
 18> what are all interfaces available in selenium?
 19> actions is class or interface?
 20> why we using testng? what are benefits we get using testng? cant we execute testcases in order
 without using testng?
 21> explain polymorphism in java.
 22> scenario: der are two methods in same class with same name with different arguments and
 different access modifers. like
 public void m1(int a){}
 private void m1(string b){}
 is it overloading or not?
 23>what are types of inheritance in java?
 24> is multiple inheritance is possible in java? tel reasons.
 25> is multilevl inheritance is possible in java? give reason.
 26> scenario: der are 10 pages in same window, an image is present in any page out of ten pages in same window.
 how will you validate this scenario?
 27> how to check image is loaded correctly or not in page?
 28> scenario: same image is present in ten pages how do you check same image present on each
 page or not. how will you validate this scenario?
 29> what is the purpose of sikuli?
 30> is it possible to compare two images with sikuli?
 31> how do you compare image in some path of drive and image on page?
 32> Tel syntax for sikuli code.
 33> how to handle file upload window in selenium?
 34> scenario: There are ten drop downs in page with same name.. in one of drop downs i have option called cts employee
 how select dat particular option in out of ten drop downs in page? what is ur approach?
 35> write a code for db connection.
 36> explain ur project structure and flow.
 37> how do u handle exception handling in selenium.
 38> explain run time and compile time polymorphiism.
 39> write a code for multiple handling windows.
 40> scenario: der is grid table 1st column contains links with same names in all rows.
 2nd column contains different name for those links present in 1st column.
 now based on 2nd column click on required link in 1st column how will you do it.
 41> how do you handle synchronization in selenium.
 42> how generate user defined exceptions, write syntax.
 43> difference between throw and throws keyword.
 44> scenario: <table
 <tr
 <td
 <td
 now based on 2nd td tag find tr tag element. write xpath for it.
 45> what is auto it? how will you exexute auto it code in selenium?
 46> how to handle elements like ajax?
 47> how to handle elements which has no attribute inside tag?
 48> what is proctractor?
 49> what are loctors present in proctractor?
 50> explain oops concepts.
 51> diff b/w sikuli and auto it.


Java:-

What is the difference between static and instance variables.

Instance variable 

  • An instance variable is one whose memory space is creating each and every time whenever an object is created.
  • Programmatically instance variable declaration should not be preceded by keyword static. 
  • Instance variable must be accessed with respect to object name 
  • Value of instance variable is not sharable. 
Static Variable 

  • Static variables are whose memory space is creating only once when the class is loaded by class loader subsystem (a part of JVM) in the main memory irrespective of number of objects. 
  • Programmatically static variable declaration must be preceded by keyword static. 
  • Static variables must be accessed with respect to class name
  • Value of static variable is always recommended for sharable. 
  • Static variable are also known as class level data members since they are dependent on classes. 

What is the difference between abstract classes and concrete classes.

Concrete classes :- 

A concrete class is one which contains fully defined methods. Defined methods are also known as implemented or concrete methods. With respect to concrete class, we can create an object of that class directly. 

Abstract classes:- 

An abstract class is one which contains some defined methods and some undefined methods. Undefined methods are also known as unimplemented or abstract methods. Abstract method is one which does not contain any definition. To make the method as abstract we have to use a keyword called abstract before the function declaration. 








Post a Comment