Flat 20% & up to 50% off + Free additional Courses. Hurry up!

Top Selenium Interview Questions And Answers

Here are top 15 objective type sample selenium Interview questions and their answers are given just below to them. These sample questions are framed by experts from Intellipaat who trains for selenium Training to give you an idea of type of questions which may be asked in interview. We have taken full care to give correct answers for all the questions. Do comment your thoughts Happy Job Hunting!

Top Answers to Selenium Interview Questions

1. What are the different Selenium components?

The suite package constitutes of the following sets of tools:

  • Selenium Integrated Development Environment (IDE) – Selenium IDE is a record and playback tool. It is distributed as a Firefox Plugin.
  • Selenium Remote Control (RC) – Selenium RC is a server that allows user to create test scripts in a desired programming language. It also allows executing test scripts within the large spectrum of browsers.
  • Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate.
  • Selenium Grid – Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently.
2. What test can selenium do?

Selenium could be used for the functional, regression, load testing of the web based application. The automation tool could be implemented for the post release validation with a continuous integration tol like Jenkins, Hudson, QuickBuild or cruiseControl.

3. What programming languages are best for writing Selenium tests?

The Web Application may be written in JAVA, Ruby, PHP, Python or any other web framework. There are certain advantages for writing test cases as application tests. For example, if the team already has the experience with Java, QA Tester could always get the piece of advice while mastering Selenium test cases in Java.
When QA Testers use the same programming language with application developers, they can get support from developers to develop the test application quicker.

4. What are the test types supported by the Selenium?

Types of tests supported by Selenium are listed below:
Selenium could be used for testing the web based applications. The test types can be supported are:
1. Functional-Functional testing is a quality assurance (QA) process and a type of black-box testing that bases its test cases on the specifications of the software component under test.

  1. Regression– Regression testingis a type of softwaretesting that seeks to uncover new software bugs, or regressions, in existing functional and non-functional areas of a system after changes such as enhancements, patches or configuration changes, have been made to them.
  2. Load testing– Load testingis the process of putting demand on a software system or computing device and measuring its response.Load testing is performed to determine a system’s behavior under both normal and anticipated peak load conditions.

The automation tool could be implemented for post release validation with continuous integration tools like:

1. Jenkins– It is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle.

2. Hudson– It is a continuous integration (CI) tool written in Java, which runs in a servlet container, such as Apache Tomcat or the GlassFish application server.

3. QuickBuild– QuickBuild provides an easy and flexible way to set up builds. When manage builds for many projects, QuickBuild’s ability to inherit and override build definitions makes the job incredibly easy. With the help of scripting and variables, QuickBuild is able to address almost all kinds of build scenarios.

4. CruiseCont– It is a Java-based framework for a continuous build process. It includes, but is not limited to, plugins for email notification, Ant, and various source control tools. A web interface is provided to view the details of the current and previous builds. It allows one to perform a continuous integration of any software development process.

5. How do I submit a form using Selenium?

WebElement el = driver.findElement(By.id(“ElementID”));

6. What are Junit annotations?

Following are the Junit Annotations:

  • @TestAnnotation lets the system know that the method annotated as @Test is a test method. There can be multiple test methods in a single test script.
  • @Before: Method annotated as @Before lets the system know that this method shall be executed every time before each of the test methods.
  • @After: Method annotated as @After lets the system know that this method shall be executed every time after each of the test methods.
  • @BeforeClass: Method annotated as @BeforeClass lets the system know that this method shall be executed once before any of the test methods.
  • @AfterClass: Method annotated as @AfterClass lets the system know that this method shall be executed once after any of the test methods.
  • @Ignore: Method annotated as @Ignore lets the system know that this method shall not be executed.
7. Can Selenium test an application on Android browser?

Selenium should be able to handle Android browser. There is a Selenium Android Driver for running tests in the Android browser.
You can use Selendroid or Appium framework to test native apps or web apps in the Android browser.

Here is some code sample for it.

public static void startSelendroidServer() throws Exception {
if (selendroidServer != null) {
SelendroidConfiguration config = new SelendroidConfiguration();
selendroidServer = new SelendroidLauncher(config);
SelendroidCapabilities caps = new SelendroidCapabilities("io.selendroid.testapp:0.9.0");
driver = new SelendroidDriver(caps);
8. When do we use findElement() and findElements()?

findElement(): findElement() is used to find the first element in the current web page matching to the specified locator value. Take a note that only first matching element would be fetched.


WebElement element =driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

findElements(): findElements() is used to find all the elements in the current web page matching to the specified locator value. Take a note that all the matching elements would be fetched and stored in the list of WebElements.

List <WebElement> elementList =driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

1. What are the driver.close and driver.quit in WebDriver? Which is more preferable?

driver.close and driver.quit are two different methods for closing the browser session in Selenium WebDriver.

  • driver.close – It closes the browser window on which the focus is set.
  • driver.quit – It basically calls driver.dispose method which in turn closes all the browser windows and ends the WebDriver session gracefully.

We should use driver.quit whenever we want to end the program. It will close all opened browser windows and terminates the WebDriver session. If we do not use driver.quit at the end of the  program, WebDriver session will not close properly and files would not be cleared off memory. This may result in memory leak errors.

2. How is Selenium 2.0 configuration different than Selenium 1.0?

In case of Selenium 1.0 we need a Selenium jar file pertaining to one library, for example, in case of Java you need a Java client driver and also Selenium server jar file.

3. Can tests recorded using Selenium IDE be run in other browsers?

Yes. Although Selenium IDE is a Firefox add on, however,the  tests created in it can also be run in other browsers by using Selenium RC (Selenium Remote Control) and specifying the name of the test suite in command line.

For example:

with command line

c:\Program Files\Mozilla Firefox\firefox.exe” -chrome “chrome://selenium-ide/content/selenium/TestRunner.html?baseURL=http://localhost&test=file:///c:\tests\testsuite.html&auto=false”

With Java program

C:\Program Files (x86)\Java\jre6\bin\java.exe” -jar c:\seltest\selenium-server-standalone-2.18.0.jar -htmlSuite “*firefox” “″ “c:\seltest\mytestsuite.html” “c:\seltest\logs\results-firefox.html” -port 5555

4. How can we handle web based pop up?

WebDriver offers the users with a very efficient way to handle these pop ups using Alert interface. There are the four methods that we would be using along with the Alert interface.

  • void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop up window appears.
  • void accept() – The accept() method clicks on the “Ok” button as soon as the pop up window appears.
  • String getText() – The getText() method returns the text displayed on the alert box.
  • void sendKeys(String stringToSend) – The sendKeys() method enters the specified string pattern into the alert box.

// accepting javascript alert
Alert alert = driver.switchTo().alert();

5. How to set the test case priority in TestNG?

Setting Priority in TestNG
Code Snippet

package TestNG;
import org.testng.annotations.*;
public class SettingPriority {
public void method1() {
public void method2() {
public void method3() {

Test Execution Sequence:
1. Method1
2. Method2
3. Method3

6. How to automate radio button in Selenium 2.0?

WebElement el = driver.findElement(By.id(“Radio button id”));

//to perform check operation


//verfiy to radio button is check it return true if selected else false


7. How to handle the AJAX popup window?

By using getWindowHandles() and obj.switchTo.window(windowid), we can handle popups using explicit wait and driver.swtchTo.window(“name”) commands for your requirements.

"4 Responses on Top Selenium Interview Questions And Answers"

  1. Rogerio Da Silva says:

    I like the questionaire. It summarises well what questions and key points that both employers and emplyees need to know.
    Thanks for sharing that.

  2. Srinivas B says:

    Thank you so much for valuable information.

  3. Karuna says:

    With this Interview Q and A. I come to know some technical tips on Selenium. It will be very helpful for my interview preparation.

  4. Shilpa says:

    This is a quality peace of work. Thank you for the good effort.

Leave a Message

Your email address will not be published.

Training in Cities

Bangalore, Hyderabad, Chennai, Delhi, Kolkata, UK, London, Chicago, San Francisco, Dallas, Washington, New York, Orlando, Boston

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.


Sales Offer

  • To avail this offer, enroll before 27th October 2016.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer
DW offer

Sign Up or Login to view the Free Top Selenium Interview Questions And Answers.