Top 10 Selenium Interview Questions with Answers

Top 10 Selenium Interview Questions with Answers

1. What is Automation Testing or Testing Automation ?

Automation testing is a process of automating the manual process to test the application/system under test. It uses separate testing tools which facilitate you to create test scripts which can be executed repeatedly and doesn’t need any manual intervention.

2. What is Selenium 1.0, Selenium 2.0, Selenium 3.0 and Selenium IDE ?

Selenium 1.0 is also known as Selenium Remote Control (Selenium RC). It is a library available in wide variety of languages. The main reason to use Selenium RC was that Selenium IDE was incapable to execute tests in browsers other than Selenium IDE and the limitation of language Selenese used in Selenium IDE.

Selenium 2.0 is a tool which is a combination of web testing tools Selenium RC and WebDriver.

Selenium 3.0 is the latest version of Selenium. There are 2 beta version of Selenium released with few changes in the previous versions.

3. How will you find an element using Selenium?

In Selenium every object or control in a web page is referred as an elements, there are different ways to find an element in a web page they are

  • ID
  • Name
  • Tag
  • Attribute
  • CSS
  • Linktext
  • PartialLink Text
  • Xpath etc

4. Why should Selenium be selected as a test tool?

Selenium

  • is free and open source
  • have a large user base and helping communities
  • have cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.)
  • have great platform compatibility (Windows, Mac OS, Linux etc.)
  • supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.)
  • has fresh and regular repository developments
  • supports distributed testing.

5.  What are the advantages of Selenium?

  • It supports C#, PHP, Java, Perl, Phython
  • It supports different OS like Windows, Linux and Mac OS
  • It has got powerful methods to locate elements (Xpath, DOM , CSS)
  • It has highly developer community supported by Google.

Want to Join in Selenium Training ?

6. Explain how Selenium Grid works?

Selenium Grid sent the tests to the hub. These tests are redirected to Selenium Webdriver, which launch the browser and run the test.  With entire test suite, it allows for running tests in parallel.

7. What are the different types of Drivers that WebDriver contains?

These are the different drivers available in WebDriver:

  • FirefoxDriver
  • InternetExplorerDriver
  • ChromeDriver
  • SafariDriver
  • OperaDriver
  • AndroidDriver
  • IPhoneDriver
  • HtmlUnitDriver

8. What is the difference between “/” and “//” in Xpath?

Single Slash “/” – Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node.

Double Slash “//” – Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document.

9. List out the test types that are supported by Selenium?

For web based application testing selenium can be used

The test types can be supported are

  • Functional, Learn More about Functional Testing.
  • Regression

For post release validation with continuous integration automation tool could be used

  • Jenkins
  • Hudson
  • Quick Build
  • CruiseCont

10. How to select value in a dropdown?

Value in the drop down can be selected using WebDriver’s Select class.

Syntax:

selectByValue:
Select selectByValue = new Select(driver.findElement(By.id(“SelectID_One”)));
selectByValue.selectByValue(“greenvalue”);

selectByVisibleText:
Select selectByVisibleText = new Select (driver.findElement(By.id(“SelectID_Two”)));
selectByVisibleText.selectByVisibleText(“Lime”);

selectByIndex:
Select selectByIndex = new Select(driver.findElement(By.id(“SelectID_Three”)));
selectByIndex.selectByIndex(2);

Jobs in Bangalore
Best Training

Quick Enquiry