QaMantra: Top 10 Most Popular Selenium job Interview Questions and answers

Top 10 Most Popular Selenium job Interview Questions and answers

Que 1:  What is Selenium ?

Ans : Selenium is a open Source  Software Automation Testing Suite , which have four components

  •  Selenium IDE 
  •  Selenium RC
  •  WebDriver   2.0  and 3.0
  •   Selenium Grid

Que 2:  What is Selenium  WebDriver ?

Ans  :    Selenium WebDriver is a Tool for Automating Web Application ,It Provides API which      Support Multiple language and Multiple Platform ,right now it has two version 

Que 3:  What is Difference Between Selenium WebDriver 2.0 and WebDriver 3.0 ? 

Ans  :    WebDriver 3.0 is a latest upgraded version of  WebDriver Interface ,Selenium WebDriver 2.0 has 3 Bug which has been Fixed in Selenium WebDriver 3.0 ,Click This Link To Know More About Difference.

Que 3:  Types of Locator in Selenium ?

Ans  :   Locators Used To find object or Element of Web Page and there are various way to find Elements :
  • ID
  • Name
  • Class Name
  • Tag Name
  • Linktext
  • PartialLink Text
  • CSS
  • Xpath 

Que 4:  Types of Wait in Selenium ?

 Ans  :   Wait in Selenium used for Synchronization between Selenium Script and  Server Response So that WebElements  presents on webpage.
  •  Hard Code wait 
  •  Page Load Timeout wait .
  •  Fluent Wait 
                             For More Detail about Wait and Their Expected use Follow Link Wait in Selenium

Que 5 :  What is Select Class and How To Select DropDown  ?

Ans :     Select is class which is used to Handles Dropdwon of  Web Application  ,User Can Select DropDown on basis of Three Parameters .
  • SelectBy VisibleText
  • SelectBy Index
  • SelectBy Value
      SelectBy VisibleText 
      Select  select  = new Select(WebElement Element);
      select.selectByVisibleText(Text) ; 
     SelectBy Index 
      Select  select  = new Select(WebElement Element);
      select.selectByIndex(Index) ;     

     SelectBy Value 
      Select  select  = new Select(WebElement Element);
      select.selectByValue(Value) ;   

Que 6 :  What is Action Class and How to perform mouse over operation  ?

Ans :    In Selenium Mouse over operation and Keyboard operation are done using Action class under Interaction API .

// To Perform Mouse Over Operation

Actions action = new Actions(driver);

Que 7 :  What is TestNG FrameWork  ?
Ans :      TestNG  is a Execution Engine and Unit Testing Framework Combination of Junit and Nunit Framework ,TestNG Annotation makes Efficient and Convenient to use Test Script .

Advance Feature of TestNG 

  • Batch Execution 
  • Group Execution
  • Parallel Execution 
  • Parameterization 
  • Emailable HTML Report

TestNG Annotations

  • @BeforeSuite
  • @BeforeClass
  • @BeforeTest
  • @BeforeMethod
  • @Test
  • @AfterMethod
  • @AfterTest
  • @AfterClass
  • @AfterSuite

Que 8 :  What is Assertion in TestNG ?

Ans :      Assertion is a feature of TestNG which is used to verify Expected Result with Actual Result ,It is Also use To use to Fail The Test Scripts ,There are two types of Assertion in TestNG.

  • Hard Assertion
  • Soft Assertion
 Hard Assertion static methods :

  •  Assertequals()
  •  AssertNotequals()
  •  AssertTrue()
  •  AssertFalse()
  •  AssertSame()
  •  AssertNotSame()
  •  AssertNull()
  •  AssertNotNull()

Que 9 :  What is a POM Framework ?

Ans :     To Increase the performance and Efficiency of Code we use POM , POM is a JAVA Design Pattern Which is used to store and initialize the WebElements for Page Decoration ,POM usage lazy initialization concept which means initialize only those WebElements which is require in Runtime .

Que 10 :  How To Handle JavaScript POPUP ?

Ans :   user can not inspect javascript popup ,javascript popup can have two option 
  •     OK                         
  •     Cancel
   // To click on OK button 
   Alert alert   =  driver.switchTo().Alert();


   //To Click on Cancel Button 

   Alert alert   =  driver.switchTo().Alert();


No comments: