Top 50 Selenium Interview Questions and Answers (2026)

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated December 1, 2025

This tutorial includes the top 50 most frequently asked Selenium interview questions, covering Selenium IDE, Selenium RC, Selenium Grid, and Selenium WebDriver.

A quick note about this Selenium article series before we move to this tutorial:

This is the last tutorial in our Selenium online training series of 30+ comprehensive tutorials. I hope you all enjoyed these tutorials and started learning from them. If you are new here, please head over to this very first tutorial in this training series.

Selenium Interview Preparation

arrow Selenium interview questions Also, check out this “The Best Online Selenium Training Course” to learn the Selenium automation tool from an expert having 10+ years of Selenium automation experience.

Quick Quiz on Selenium Interview Questions with Final Result

Before checking out the entire list of Selenium Interview Questions, want to take this quick test to know where you are?

Quiz on Selenium Interview Questions
1 of 18 You’re doing great!
WebDriver Fundamentals
Loading question…
Quiz Complete!
0 / 18
0%
Performance by Category
Next Steps for Success

Top 50 Selenium Interview Questions and Answers

Here we go.

Q #1) What is Automation Testing?

Automation testing or Test Automation is a process of automating the manual process to test the application/system under test. Automation testing involves the use of a separate testing tool that lets you create test scripts that can be executed repeatedly and don’t require any manual intervention.

Q #2) What are the benefits of Automation Testing?

The benefits of automation testing are:

  1. Supports execution of repeated test cases
  2. Aids in testing a large test matrix
  3. Enables parallel execution
  4. Encourages unattended execution
  5. Improves accuracy, reducing human-generated errors
  6. Saves time and money

Q #3) Why should Selenium be selected as a test tool?

Selenium

  1. Is a free and open-source
  2. Have a large user base and help communities
  3. Have cross-browser compatibility (Firefox, Chrome, Internet Explorer, Safari, etc.)
  4. Have great platform compatibility (Windows, Mac OS, Linux, etc.)
  5. Supports multiple programming languages (Java, C#, Ruby, Python, Pearl, etc.)
  6. Has fresh and regular repository developments
  7. Supports distributed testing

Q #4) What is Selenium? What are the different Selenium components?

Selenium is one of the most popular automated testing suites. Selenium is designed in a way to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms. Being present in the open-source community, it has become widely embraced by testing professionals.

Selenium is not just a single tool or a utility, but a package of several testing tools, and for the same reason, it is referred to as a suite. Each of these tools caters to different testing and test environment requirements.

The suite package constitutes 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 a user to create test scripts in the desired programming language. It enables the execution of test scripts across a wide range 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.

Q #5) What are the testing types that can be supported by Selenium?

Selenium supports the following types of testing:

  1. Functional Testing
  2. Regression Testing

Q #6) What are the limitations of Selenium?

The following are the limitations of Selenium:

  • Selenium supports testing of only web-based applications.
  • Selenium is not suitable for testing mobile applications.
  • Captcha and Barcode readers cannot be tested using Selenium.
  • Reports can only be generated using third-party tools like TestNG or JUnit.
  • As Selenium is a free tool, thus there is no ready vendor support through which the user can find numerous helping communities.
  • The user is expected to possess prior programming language knowledge.

Q #7) What is the difference between Selenium IDE, Selenium RC, and WebDriver?

FeatureSelenium IDESelenium RCWebDriver
Browser CompatibilitySelenium IDE comes as a Firefox plugin, thus it supports only FirefoxSelenium RC supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera.WebDriver supports a varied range of versions of Mozilla Firefox, Google Chrome, Internet Explorer and Opera.
Also supports HtmlUnitDriver which is a GUI less or headless browser.
Record and PlaybackSelenium IDE supports record and playback featureSelenium RC doesn’t supports record and playback feature.WebDriver doesn’t support record and playback feature
Server RequirementSelenium IDE doesn’t require any server to be started before executing the test scriptsSelenium RC requires server to be started before executing the test scripts.WebDriver doesn’t require any server to be started before executing the test scripts
ArchitectureSelenium IDE is a Javascript based frameworkSelenium RC is a JavaScript based Framework.WebDriver uses the browser’s native compatibility to automation
Object OrientedSelenium IDE is not an object oriented toolSelenium RC is semi object oriented tool.WebDriver is a purely object oriented tool
Dynamic Finders
(for locating web elements on a webpage)
Selenium IDE doesn’t support dynamic findersSelenium RC doesn’t support dynamic finders.WebDriver supports dynamic finders
Handling Alerts, Navigations, DropdownsSelenium IDE doesn’t explicitly provides aids to handle alerts, navigations, dropdownsSelenium RC doesn’t explicitly provides aids to handle alerts, navigations, dropdowns.WebDriver offers a wide range of utilities and classes that helps in handling alerts, navigations, and dropdowns efficiently and effectively.
WAP(iPhone/Android)TestingSelenium IDE doesn’t support testing of iPhone/Andriod applicationsSelenium RC doesn’t support testing of iPhone/Android applications.WebDriver is designed in a way to efficiently support testing of iPhone/Android applications. The tool comes with a large range of drivers for WAP based testing.
For example, AndroidDriver, iPhoneDriver
Listener SupportSelenium IDE doesn’t support listenersSelenium RC doesn’t support listeners.WebDriver supports the implementation of Listeners
SpeedSelenium IDE is fast as it is plugged in with the web-browser that launches the test. Thus, the IDE and browser communicates directlySelenium RC is slower than WebDriver as it doesn’t communicates directly with the browser; rather it sends selenese commands over to Selenium Core which in turn communicates with the browser.WebDriver communicates directly with the web browsers. Thus making it much faster.

Q #8) When should I use Selenium IDE?

Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature makes it exceptionally easy to learn with minimal acquaintance with any programming language. Selenium IDE is an ideal tool for a naïve user.

Q #9) What is Selenese?

Selenese is the language that is used to write test scripts in Selenium IDE.

Q #10) What are the different types of locators in Selenium?

The locator serves as an address that uniquely identifies a web element within the webpage. Thus, to identify web elements accurately and precisely, we have different types of locators in Selenium:

  • ID
  • ClassName
  • Name
  • TagName
  • LinkText
  • PartialLinkText
  • Xpath
  • CSS Selector
  • DOM

Q #11) What is the difference between assert and verify commands?

Assert: Assert command checks whether the condition is true or false. Let’s say we assert whether the element is present on the web page or not. If the condition is true, then the program control will execute the next test step, but if the condition is false, the execution will stop and no further test will be executed.

Verify: Verify command also checks whether the condition is true or false. Irrespective of the condition being true or false, the program execution doesn’t halt, i.e. any failure during verification would not stop the execution and all the test steps would be executed.

Q #12) What is an XPath?

XPath is used to locate a web element based on its XML path. XML stands for Extensible Markup Language and stores, organizes, and transports arbitrary data. It stores data in a key-value pair, which is very similar to HTML tags. Both are markup languages and since they fall under the same umbrella, XPath can locate HTML elements.

The fundamental behind locating elements using XPath is the traversing between various elements across the entire page, thus enabling a user to find an element with the reference of another element.

Q #13) What is the difference between “/” and “//” in Xpath?

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

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

Q #14) What is the same origin policy and how it can be handled?

The problem posed by the same origin policy prohibits the retrieval of the DOM of a document from an origin that differs from the origin we are trying to access.

Origin sequentially combines the scheme, host, and port of the URL. For example, for a URL https://www.softwaretestinghelp.com/resources/, the origin is a combination of http, softwaretestinghelp.com, 80 correspondingly.

Thus, the Selenium Core (JavaScript Program) cannot access the elements from an origin that differs from where it was launched.

For Example, if I have launched the JavaScript Program from “https://www.softwaretestinghelp.com”, then I can access the pages within the same domain such as “https://www.softwaretestinghelp.com/resources” or “https://www.softwaretestinghelp.com/istqb-free-updates/”. The other domains like google.com and seleniumhq.org would no more be accessible.

So, to handle the same origin policy, Selenium Remote Control was introduced.

Q #15) When should I use Selenium Grid?

Selenium Grid can execute the same or different test scripts on multiple platforms and browsers concurrently to achieve distributed test execution, testing under different environments and saving execution time remarkably.

Q #16) What do we mean by Selenium 1 and Selenium 2?

Selenium RC and WebDriver, in combination, are popularly known as Selenium 2. Selenium RC alone is also referred to as Selenium 1.

Q #17) Which is the latest Selenium tool?

WebDriver

Q #18) How do I launch the browser using WebDriver?

The following syntax can launch the Browser:

WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();

Q #19) What are the different types of Drivers available in WebDriver?

The different drivers available in WebDriver are:

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

Q #20) What are the different types of waits available in WebDriver?

There are two types of waits available in WebDriver:

  1. Implicit Wait
  2. Explicit Wait

Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds) between each consecutive test step/command across the entire test script. Thus, the subsequent test step would only execute when the 30 seconds have elapsed after executing the previous test step/command.

Explicit Wait: Explicit waits are used to halt the execution until a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a particular instance only.

Q #21) How to type in a textbox using Selenium?

The user can use sendKeys(“String to be entered”) to enter the string in the textbox.

Syntax:
WebElement username = drv.findElement(By.id(“Email”));
// entering username
username.sendKeys(“sth”);

Q #22) How can you find if an element is displayed on the screen?

WebDriver facilitates the user with the following methods to check the visibility of the web elements. These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels, etc.

  1. isDisplayed()
  2. isSelected()
  3. isEnabled()

Syntax:

isDisplayed():

boolean buttonPresence = driver.findElement(By.id("gbqfba")).isDisplayed();

isSelected():

boolean buttonSelected = driver.findElement(By.id("gbqfba")).isSelected();

isEnabled():

boolean searchIconEnabled = driver.findElement(By.id("gbqfb")).isEnabled();

Q #23) How can we get the text of a web element?

Get command is used to retrieve the inner text of the specified web element. The command doesn’t require any parameter but returns a string value. It is also one of the extensively used commands for verification of messages, labels, errors, etc displayed on the web pages.

Syntax:

String Text = driver.findElement(By.id("Text")).getText();

Q #24) How to select the value in a dropdown?

The value in the dropdown 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);

Q #25) What are the different types of navigation commands?

Following are the navigation commands:
navigate().back() – The above command requires no parameters and takes back the user to the previous webpage in the web browser’s history.

Sample code:

driver.navigate().back();

navigate().forward() – This command lets the user navigate to the next web page concerning the browser’s history.

Sample code:

driver.navigate().forward();

navigate().refresh() – This command lets the user refresh the current web page there by reloading all the web elements.

Sample code:

driver.navigate().refresh();

navigate().to() – This command lets the user launch a new web browser window and navigate to the specified URL.

Sample code:

driver.navigate().to(“https://google.com”);

Q #26) How to click on a hyperlink using linkText?

driver.findElement(By.linkText("Google")).click();

The command finds the element using link text and then clicks on that element and thus the user will be re-directed to the corresponding page.

The above-mentioned link can also be accessed by using the following command.

driver.findElement(By.partialLinkText("Goo")).click();

The above command finds the element based on the substring of the link provided in the parenthesis and thus partialLinkText() finds the web element with the specified substring and then clicks on it.

Q #27) How to handle frame in WebDriver?

An inline frame acronym iframe is used to insert another document within the current HTML document or simply a web page into a web page by enabling nesting.

Select iframe by id

driver.switchTo().frame("ID of the frame");

Locating iframe using tagName

driver.switchTo().frame(driver.findElements(By.tagName("iframe").get(0));

Locating iframe using index

frame(index)

driver.switchTo().frame(0);

frame(Name of Frame)

driver.switchTo().frame(“name of the frame”);

frame(WebElement element)
Select Parent Window

driver.switchTo().defaultContent();

Q #28) When do we use findElement() and findElements()?

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

Syntax:

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 the specified locator value. Take note that all the matching elements would be fetched and stored in the list of WebElements.

Syntax:

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

Q #29) How to find more than one web element in the list?

We may come across elements of the same type, like multiple hyperlinks, images, etc arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with such elements by a single piece of code and this can be done using WebElement List.

Sample Code

// Storing the list
List <WebElement> elementList = driver.findElements(By.xpath("//div[@id='example']//ul//li"));
// Fetching the size of the list
int listSize = elementList.size();
for (int i=0; i<listSize; i++)
{
// Clicking on each service provider link
serviceProviderLinks.get(i).click();
// Navigating back to the previous page that stores link to service providers
driver.navigate().back();
}

Q #30) What is the difference between driver.close() and driver.quit command?

close(): WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does it return any value.

quit(): Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does it return any value.

Q #31) Can Selenium handle Windows-based pop up?

Selenium is an automation testing tool that supports only web application testing. Therefore, windows pop-ups cannot be handled using Selenium.

Suggested Reading => Java Architect Interview Questions

Q #32) How can we handle web-based pop-ups?

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

  • void dismiss() – The dismiss() 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.

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

Q #33) How can we handle Windows-based pop-ups?

Selenium is an automation testing tool that supports only web application testing, which means it doesn’t support testing of Windows-based applications.

However, Selenium alone cannot help the situation, but combining it with some third-party intervention can overcome this problem. There are several third-party tools available for handling Windows-based pop-ups along with the selenium like AutoIT, Robot class, etc.

Q #34) How to assert the title of the web page?

//verify the title of the web page
assertTrue(“The title of the window is incorrect.”,driver.getTitle().equals(“Title of the page”));

Q #35) How to mouse hover on a web element using WebDriver?

WebDriver offers a wide range of interaction utilities that the user can exploit to automate mouse and keyboard events. Action Interface is one such utility that simulates a single-user interaction.

Thus, in the following scenario, we have used Action Interface to mouse hover on a drop down, which then opens a list of options.

Sample Code:

// Instantiating Action Interface
Actions actions=new Actions(driver);
// howering on the dropdown
actions.moveToElement(driver.findElement(By.id("id of the dropdown"))).perform();
// Clicking on one of the items in the list options
WebElement subLinkOption=driver.findElement(By.id("id of the sub link"));
subLinkOption.click();

Q #36) How to retrieve CSS properties of an element?

The values of the CSS properties can be retrieved using a get() method:

Syntax:
driver.findElement(By.id(“id”)).getCssValue(“name of css attribute”);
driver.findElement(By.id(“id”)).getCssValue(“font-size”);

Q #37) How to capture screenshots in WebDriver?

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
 
public class CaptureScreenshot {
       WebDriver driver;
       @Before
       public void setUp() throws Exception {
            driver = new FirefoxDriver();
            driver.get("https://google.com");
     }
     @After
     public void tearDown() throws Exception {
            driver.quit();
     }

     @Test
     public void test() throws IOException {
            // Code to capture the screenshot
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
            // Code to copy the screenshot in the desired location
FileUtils.copyFile(scrFile, new File("C:\\CaptureScreenshot\\google.jpg"));                  
     }
}

Q #38) What is JUnit?

JUnit is a unit testing framework introduced by Apache. Junit is based on Java.

Q #39) What are Junit annotations?

Following are the JUnit Annotations:

  • @Test: Annotation 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 method.
  • @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.

Q #40) What is TestNG and how is it better than JUnit?

TestNG is an advanced framework designed in a way to leverage the benefits of both the developers and testers. With the commencement of the frameworks, JUnit gained enormous popularity across Java applications, Java developers, and Java testers with remarkably increasing code quality.

Despite being easy to use and straightforward, JUnit has its limitations, which give rise to the need to bring TestNG into the picture. TestNG is an open-source framework that is distributed under the Apache Software License and is readily available for download.

TestNG with WebDriver provides an efficient and effective test result format that can be shared with the stakeholders to have a glimpse of the product’s/application’s health, thereby eliminating the drawback of WebDriver’s incapability to generate test reports. TestNG has an inbuilt exception-handling mechanism that lets the program run without terminating unexpectedly.

Various advantages make TestNG superior to JUnit. Some of them are:

  • Added advance and easy annotations
  • Execution patterns can set
  • Concurrent execution of test scripts
  • Test case dependencies can be set

Q #41) How to set test case priority in TestNG?

Setting Priority in TestNG

Code Snippet

package TestNG;
import org.testng.annotations.*;
public class SettingPriority {
      @Test(priority=0)
      public void method1() {   
      }
      @Test(priority=1)
      public void method2() {  
      }
      @Test(priority=2)
      public void method3() {   
      }
}

Test Execution Sequence:

  1. Method1
  2. Method2
  3. Method3

Q #42) What is a framework?

The framework is a constructive blend of various guidelines, coding standards, concepts, processes, practices, project hierarchies, modularity, reporting mechanisms, test data injections, etc. to pillar automation testing.

Q #43) What are the advantages of the Automation framework?

The advantage of Test Automation framework

  • Reusability of code
  • Maximum coverage
  • Recovery scenario
  • Low-cost maintenance
  • Minimal manual intervention
  • Easy Reporting

Q #44) What are the different types of frameworks?

Below are the different types of frameworks:

  1. Module Based Testing Framework: The framework divides the entire “Application Under Test” into a number of logical and isolated modules. For each module, we create a separate and independent test script. Thus, when these test scripts are taken together builds a larger test script representing more than one module.
  2. Library Architecture Testing Framework: The basic fundamental behind the framework is to determine the common steps and group them into functions under a library and call those functions in the test scripts whenever required.
  3. Data Driven Testing Framework: Data Driven Testing Framework helps the user segregate the test script logic and the test data from each other. It lets the user store the test data into an external database. The data is conventionally stored in “Key-Value” pairs. Thus, the key can access and populate the data within the test scripts.
  4. Keyword Driven Testing Framework: The Keyword Driven testing framework is an extension of Data-driven Testing Framework in the sense that it not only segregates the test data from the scripts, it also keeps a certain set of code belonging to the test script into an external data file.
  5. Hybrid Testing Framework: Hybrid Testing Framework is a combination of more than one of the above-mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all kinds of associated frameworks.
  6. Behavior Driven Development Framework: Behavior Driven Development framework allows automation of functional validations in an easily readable and understandable format to Business Analysts, Developers, Testers, etc.

Q #45) How can I read test data from excels?

Test data can efficiently be read from excel using JXL or POI API. See detailed tutorial here.

Q #46) What is the difference between POI and jxl jar?

#JXL jarPOI jar
1JXL supports “.xls” format i.e. binary based format. JXL doesn’t support Excel 2007 and “.xlsx” format i.e. XML based formatPOI jar supports all of these formats
2JXL API was last updated in the year 2009POI is regularly updated and released
3The JXL documentation is not as comprehensive as that of POI POI has a well prepared and highly comprehensive documentation
4JXL API doesn’t support rich text formattingPOI API supports rich text formatting
5JXL API is faster than POI APIPOI API is slower than JXL API

Q #47) What is the difference between Selenium and QTP?

FeatureSelenium Quick Test Professional (QTP)
Browser CompatibilitySelenium supports almost all the popular browsers like Firefox, Chrome, Safari, Internet Explorer, Opera etcQTP supports Internet Explorer, Firefox and Chrome. QTP only supports Windows Operating System
DistributionSelenium is distributed as an open source tool and is freely availableQTP is distributed as a licensed tool and is commercialized
Application under Test Selenium supports testing of only web based applicationsQTP supports testing of both the web based application and windows based application
Object RepositoryObject Repository needs to be created as a separate entityQTP automatically creates and maintains Object Repository
Language SupportSelenium supports multiple programming languages like Java, C#, Ruby, Python, Perl etcQTP supports only VB Script
Vendor SupportAs Selenium is a free tool, user would not get the vendor’s support in troubleshooting issuesUsers can easily get the vendor’s support in case of any issue

Q #48) Can WebDriver test Mobile applications?

WebDriver cannot test mobile applications. WebDriver is a web-based testing tool, therefore applications on mobile browsers can be tested.

Q #49) Can a captcha be automated?

No, a captcha and barcode reader cannot be automated.

Q #50) What is an Object Repository? How can we create an Object Repository in Selenium?

Object Repository is a term used to refer to the collection of web elements belonging to the Application Under Test (AUT) along with their locator values. Thus, whenever the element is required within the script, the locator value can be populated from the Object Repository. Object Repository is used to store locators in a centralized location instead of hardcoding them within the scripts.

In Selenium, objects can be stored in an Excel sheet which can be populated inside the script whenever required.

That’s all for now.

Hope in this article you will find answers to the most frequently asked Selenium and WebDriver Interview questions. The answers provided here are also helpful for understanding the Selenium basics and advanced WebDriver topics.

Do you have any Selenium Interview questions that are not answered here? Please let us know in the comments below and we will try to answer all.

=> This finishes not just this article but our complete Selenium training series. Check the list of ALL 30+ tutorials listed on this page. Please let us know your comments and questions.

Was this helpful?

Thanks for your feedback!

Recommended Reading

  • Top Interview Questions & Answers

    Lists popular Software Testing and related Technical Interview Questions and answers on the most common software testing & technical topics: Let us see some of the most frequently asked interview questions and answers on Software Testing and other related technical topics in the tutorials listed below. Select the link you…

  • ETL Testing

    List of Most Frequently Asked ETL Testing Tools Interview Questions And Answers to Help You Prepare For The Upcoming Interview: Business information and the data are of key importance to any business and company. Many companies invest a lot of time and money in the process of analyzing and sorting…

  • XML Interview Questions

    Comprehensive list of most frequently asked basic and advanced XML Interview Questions with detailed explanation and code examples: XML is mainly preferred by the developers for designing, developing, and maintaining interfaces. The reason for which most of them prefer XML over HTML is that XML allows you to define your…

  • CCNA Interview Questions and Answers

    Top 50 most popularly asked interview questions and answers for cracking any CCNA interview are listed in this article. Firstly, we would recommend you to go through the tutorials of CCNA series that we have posted earlier, in order to understand the basics of CCNA. These questions will definitely help…


READ MORE FROM THIS SERIES:



423 thoughts on “Top 50 Selenium Interview Questions and Answers (2026)”

  1. Very useful information.

    Thanks and much appreciated.

    Could you please reply back on below comment #.
    #7 Nikesh
    Ans to Q#49 is wrong.

    Thanks.

    Reply
  2. Hello team,

    You’ve mistakenly mentioned selenium RC is introduced to overcome Same origin policy in question no.14.

    But, Same origin policy is the only reason to avoid using Selenium RC and because of that they introduced WebDriver to overcome this problem.

    Please update the same, if I am not wrong.

    Reply
  3. Typo error in the Below line

    void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop-up window appears.

    Reply
  4. Please verify the syntax specified in Q 28,
    one should be for findElement and another should be findElements :

    Find Element:
    Actual : WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
    Correction : WebElement element = driver.findElement(By.xpath(“//div[@id=’example’]//ul//li”));

    Find Elements:
    List elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

    Reply
    • First, If you want to scroll horizontally in the right direction, use the following JavaScript. ((JavascriptExecutor)driver). executeScript(“window. scrollBy(2000,0)”);
      Second, ((JavascriptExecutor)driver). executeScript(“window. scrollBy(-2000,0)”);
      Jun 21, 2015

      Reply
  5. Very helpful series of Selenium. I would request “SoftwareTestingHelp” team to make a mobile app so anytime, anywhere we can use it..

    Thank you for making this series available for us.

    I wish all the best for future articles.

    Reply
  6. Hello Sir,
    As a fresher these interview questions helps me a lot to know about the subject and also gave me more confident to attend my interview perfectly.

    Reply
  7. Hi, how do we create batch file(.bat) to execute selenium test suite when we are adding jar/library files using Maven dependencies.

    Reply
  8. Hi, I want to know data driven testing using web driver through excel sheet and CSV file.
    Could you please help it out.

    Reply
  9. Hello,
    This is very helpful for us to rush into interview. Thanks for posting such a wonderful notes and making the interviews easy…thanku.

    Reply
  10. isSelected():
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).*isDisplayed*();

    should be
    isSelected():
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();

    Reply
  11. hI,

    tHIS aRTICLE IS REALLY HELPFUL.
    Thank You for sharing such a understandable answers.
    Can you please update read value from excel concept as a sample code?

    Reply
    • constuctor is a type of method which gets execueted as soon as object is created

      constructor name should be same as class name
      and it doesnot have any return type

      Reply
  12. Hi,
    very useful blog, well done,
    please provide some information about new version of selenium.

    thanks.

    Reply
    • FOR IMPLICIT WAIT::Webdriver d;
      d.manage().timeout().implicitwait(10, TimeUnit.SECONDS);
      FOR EXPLICIT WAIT:: WebDriverWait w= new WebDriverWait(d,10);(driver, timeunit in seconds)
      For condition:: here condition is that where u want explicit wait to mention, suppose u want to wait for finding a perticular webelement then u can give explicit wait for 1 webelement

      w.until(ExpectedConditions.alertspresent());

      Reply
  13. Thanks for putting together such wonderful post. This is going to help a lot of us.

    Just to add some information for
    Q48: ” Can WebDriver test Mobile applications?”
    a) Mobile applications cannot be automated with WebDriver alone, However with help of third party toold like “appium” mobile application can be automated.

    Reply
  14. Hi,

    It’s a very good post. I think adding Q&A about page object could be great. It’s a widely used pattern nowadays.

    Reply
  15. Hi,

    This is wonderful post but can you please let me know what all concepts are must for me to crack any interview for Selenium. Thanks in advance for your response.

    Reply
  16. Really nice and helping to the new learners as Anbarasu M said above.

    I appreciate and request you to post more questions with easy answers.

    I hope you will post.

    Reply
  17. In Selenium IDE I am writting an program to generate the order number. So the next time when I run it throws an error because it has the same Order number. How to handle this

    Reply
  18. Mobile apps can be tested as we had done it for Andriod, HTML5, Windows, Blackberry and to some extent iOS too way back in 2011 to 2013.
    Really surprising answer.

    Reply
  19. Which installation required for selenium web driver using C# In visual studio, Please give me the detail list of installations step by step.

    Reply
  20. Thanks a ton for these questions. They really help.

    You could also please include these as well:

    51. What is the difference between driver.get() and driver.navigate().to() commands?

    52. Can’t we use

    FirefoxDriver() driver = new FirefoxDriver(); instead of
    WenbDriver driver = new FirefoxDriver();

    Reply
  21. Hello There,
    Please correct syntax of mentioned question
    Q #28) Syntax
    WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

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

    Thank you.

    Reply
  22. Actually my problem is that i have used javascriptexecutor to find the element by id but id of that element has to change everytime so i know in that case dynamic xpath should be used but result is coming with some error so can you help me how to write dynamic xpath in javascriptexecutor.

    Reply
  23. Thank you for this article, it was very informative.
    Recently i had attended an interview on selenium where they had asked me to write a webdriver program to count the number of hyperlinks in a webpage. It is also most frequent question now a days. so pls add this question to the list it might be useful for someone else.

    Reply
  24. please any one explaining frameworks and how to implement framework,jar files and testng files in project

    please explaining

    thanking you..

    Reply
  25. I have a question.

    Question.
    Suppose you have automated all the 1000 test cases. If client asked to run two test cases suppose those are 576 and 598. Then how will it performed ?

    Reply
  26. Hi Shruthi, This is really helpful to new learner and they can be easily able to understood about selenium.

    Thanks for this post..

    Have a great future….

    Reply
  27. How is a constructor used in Selenium ? Very important please add this.

    It is used in Page Object Model. Our BasePage class will have a constructor which takes a WebDriver object to initialize a WebDriverWait object. The constructor will also be responsible to initialize WebElements via PageFactory.

    Reply
  28. Selenium is the most effective test automation tool for qa due to its wide range of features such as open source, supports many languages, integrates easily with many platforms, has cross browser support and is best suited to test web applications. Hence, businesses need to prefer selenium tool as a promising test automation tool for web applications testing.

    Reply
  29. HI Team, Can you please check is it really possible to switch to frame using ID in Q27.

    Select iframe by id
    driver.switchTo().frame(“ID of the frame“);

    Reply
  30. Good Artical!!!!!!!!!!
    This looks good for Selenium beginners…. try to post few complex questions which exp guys will face…..

    Eg: how to handle dynamic text boxes ,
    dynamic elements handlings,
    can we have -ve priority or not ,
    How to handle Keyboard using diff class avaliable in selenium…..etc….

    Thanks

    Reply
  31. package one;

    import java.util.Iterator;
    import java.util.List;

    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.testng.Assert;

    public class Wells {

    public static void main(String[] args) {

    //1 verify credit cards present in Banking if not continue

    //locate banking block

    System.setProperty(“webdriver.chrome.driver”, “chromedriver.exe”);
    WebDriver driver = new ChromeDriver();
    driver.get(“https://www.wellsfargo.com/sitemap”);

    String searchingText = “Credit Cards”;
    boolean flag=false;
    WebElement creditCardLink;

    // 1. Finding Credit cards in Banking

    List banking =driver.findElements(By.xpath(“//*[@id=’contentBody’]/div[1]//a”));

    WebElement CreditCardBanking = searchLink(banking,searchingText);
    if (CreditCardBanking != null){
    System.out.println(“Credit Cards is present “);
    }

    flag = false;

    // 2. Verify Credit card is present in or not in the Loans and Credit

    List LoadnandCredit = driver.findElements(By.xpath(“//*[@id=’contentBody’]/div[2]//a”));

    WebElement creditCardLoan = searchLink(LoadnandCredit ,searchingText);

    Assert.assertNotNull(creditCardLoan);

    System.out.println(“tested”);

    // 3 click on credit card link in Loans and credit

    creditCardLoan.click();

    // 4 Get URL of the Browser

    System.out.println(driver.getCurrentUrl());

    // 5 verify Title of the window is “Credit Cards – Apply for a Credit Card Online – Wells Fargo”

    Assert.assertEquals(driver.getTitle(),”Credit Cards – Apply for a Credit Card Online – Wells Fargo”);;

    driver.close();
    }

    public static WebElement searchLink(List locator, String searchingText) {
    boolean flag = true;
    ;
    WebElement link,ccLink=null;
    String linkText;

    Iterator itr = locator.iterator();

    while(itr.hasNext()){
    link = itr.next();
    linkText = link.getText();
    if (linkText.equals(searchingText)){
    flag = true ;
    ccLink = link;
    }
    }

    return ccLink;
    }

    }

    Reply
  32. i want to knw how to test multiple tests in multiple browsers at time using grid.do u have any code.pls post in ur website.

    Reply
  33. Questionnaire
    1. When would you plan/start automation for a project? What would be your pre-requisites?
    2. If you have to automate scripts for 2 or more websites that have similar functionality what would your automation approach be?
    3. Define your strategy on integration of automation with CI/CD?
    4. Create and provide a couple of automation scripts on any ecommerce user flow with the automation tool you are working with.
    5. How would you strategize a release in Agile?
    6. Use Case: You are working on a time sensitive project and you realize the quality of the code is not satisfactory. How would you handle this situation?

    please help me this Questionnaire

    Reply
  34. Hi,

    The tutorial is very clear and understandable. Thank you so much as it is very useful for preparing interviews.

    Reply
  35. On Q#32,

    void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop up window appears.

    – In the above sentence, the word “accept()” should be replaced with “dismiss()”.

    Reply
  36. Interviewer can ask below given question on core java points. Prepare these thing before interview
    1. Interface
    2. Inheritance
    3. String
    4. Collection framework

    Reply
  37. actions.moveToElement(driver.findElement(By.id(“id of the dropdown”))).perform();

    You forgot to call the build() method before the perform()

    Reply
    • PAGE OBJECT MODEL :-
      1.create separate object repository to store the object locators
      2.for each web page there should be a separate page class
      3.the page class will have all object locators and preferably action methods for the corresponding webpage

      BENEFITS OF POM:-
      1.Test objects and functions are separated for easy maintenance and keeping the code clean
      2.objects are kept separated from test scripts and can be used multiple times in multiple scripts
      3.every unique object locator is created only once
      4.easy maintence and less rework.

      Reply
  38. Q 32) Instead of dismiss in the explanation you’ve written accept() for both accept() as well as dismiss(). Apart from this, the Article is superb.
    void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop up window appears.

    Reply
  39. q-28 When do we use findElement() and findElements()?
    you did one mistake in findelement syntx,
    driver.findelement.(BY.id(“behbvr”));
    PLEASE do change.

    Reply
    • Hi,

      Action is an interface and Actions is a Class

      Actions class is based on builder design pattern which builds a composite actions with the aggregation of Selenium WebDriver, where webdriver is only used to identify the presence of web elements on web application

      Action interface is only used to represent the single user interaction i.e to perform the series of action items build by Actions class.

      Reply
  40. How to explain automation life cycle? and
    what is actual automation process (selenium)in practical ?
    plz mail me

    Reply
  41. Hi,

    There is one correction in below question and answer,

    Q #24) How to select value in a dropdown?

    isSelected():
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isDisplayed();

    Please, fix this answer.

    Shyamal

    Reply
    • No,using selenium tool we can tested only the web based applications(like html documents )
      and window popup’s are not handles y using selenium, using autoIT and robot we can handle it

      Reply
  42. Thanks for sharing your knowledge.
    In the types of framework I could not see Page object model which is used extensively across the market, please include materials regarding POM framework.

    Reply
  43. Your post is mostly useless !

    The testng vs junit question does not tell us how the two are different. Instead there are a lot of unrelated points like open source in that answer. Looks like you get paid by the word.

    Reply
  44. WebDriver driver = new ChromeDriver();
    WebDriver driver = new InternetExplorerDriver(); we cannot launch InternetExplorer and Chrome driver directly usinh instance.we need set systemproperty

    Reply
  45. Above questions are very helpful and I think you should add some advanced level questions. I have been asked questions in interview like:
    – What are the problems you have faced while scripting in selenium and how did you resolve them.
    – What are disadvantage of POM.
    – what is desiredCapabilities
    – Questions from TestNG.

    Reply
  46. Correct the answer at #27
    driver.switchTo().frame(driver.findElements(By.tagName(“iframe”).get(0));
    should be
    driver.switchTo().frame(driver.findElements(By.tagName(“iframe”)).get(0);

    Reply
  47. I started learning selenium some 1 months back and believe me whatever you have posted have helped me lot to acquire proficiency in selenium.
    I think your post is phenomenal for interview purpose and its also a synopsis of selenium overall.
    Keep it up and kudos to you for your efforts.
    Cheers Shruti!!!..:)

    Reply
  48. In question 35 Line of code 2
    actions.moveToElement(driver.findElement(By.id(“id of the dropdown”))).perform();
    Its should use build().perform() istead of perform()

    Please correct it

    Reply
  49. Hi,

    The above article is very useful to know the important questions asked in the interviews.But If you can explain more about object repository then it will be a great help.

    Thanks,
    Savitri

    Reply
  50. Thank you for sharing this information on Selenium Testing
    Selenium is an open-source, test automation tool that has become an important automation tool in the software quality assurance world. This selenium testing tool consists of a different set of tools which include Selenium WebDriver, Selenium RC, Selenium IDE, and Selenium Grid, all of which have different features.

    Reply
  51. At Q #22) How can you find if an element in displayed on the screen?

    Is the below method explanation is typo error or what?
    isSelected():
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isDisplayed();

    I guess it should be :
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();

    Please correct me if I am wrong.

    Reply
  52. guys i have a question that i got from interview . The interviewer was asking me
    li a
    li a
    a
    a
    he gave me Dom Stracture and asked me what is the xpath for value a ?
    i was totally confused and i inspected the elements and given value of xpath to a as = //@magicdom#@!/*&/
    can any one solve my problem

    Reply
  53. Awesome article! Thanks a lot for the share.

    I would only request the author to keep it up to date from time to time. Will be really helpful !

    Reply
  54. FOR IMPLICIT WAIT::Webdriver d;
    d.manage().timeout().implicitwait(10, TimeUnit.SECONDS);
    FOR EXPLICIT WAIT:: WebDriverWait w= new WebDriverWait(d,10);(driver, timeunit in seconds)
    For condition:: here condition is that where u want explicit wait to mention, suppose u want to wait for finding a perticular webelement then u can give explicit wait for 1 webelement

    w.until(ExpectedConditions.alertspresent());

    Reply
  55. I have one problem after lunching web browser ,i am not getting my “URL ” i have written right code only..???

    Reply
  56. please can u give me a answar
    i was went a interview last 5 days back that time intervier asked
    can u tell me any 3 real time exceptions in selenium

    Reply
  57. Q

    Write your gherkin format and run it to create your Step definition. How do you know your test has passed?

    Reply
  58. Hi,
    This is helpful for selenium students. In Q22 have some wrong statement. please check this as a report.

    this isSelected():
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();

    Reply
  59. Hello Sir,
    One clarification testers are required for big companies or small companies?
    Any need of testers in a company,if if how for…..what is our preference
    Why all are asking experience and offers low salary.
    Please give ans.
    Thank you

    Reply
    • isSelected(): – by using this statement to make sure that WebElement is ” isSelected ”
      for checkboxes like that

      Example :- if we write like this
      boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();
      sop( buttonSelected );

      output :- if element is selected in that webpage then it will return the output
      “TRUE”
      otherwise “FALSE ”
      like wise IsDisplayed and IsEnablead

      Reply
  60. Question 29:

    I feel like this will generate a StaleElementReferenceException. You have returned to a page and tried to click on an element you retrieved before you left the page. I haven’t verified, but that sounds like a stale element to me.

    Reply
  61. WebDriver is a web-based testing tool, therefore applications on the mobile browsers can be tested.

    correct this statement it should be therefore applications on the mobile browsrs can not be tested using WebDriver.

    Reply
  62. “selenium-server-standalone” jar contains all the library files to run automation scripts then why do we need to use “selenium-java” jars?

    Reply
  63. Awesome introduction to basics of selenium, if possible post some more real time challenging interview questions.

    Like Comparing the logo on web page, To cross verify the web page opened is correct or not, to check how many advertisement windows opened in 1 web page, counting number of elements present on web page with 1 line of code.

    Reply
  64. 1)How to enter text in textbox without using send keys.
    2) How to select a webelement in the calender without using loops.

    Reply
  65. Hi I Q -28 ) – findElement() – syntax is incorrect

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

    Note : use findelement instead of findelements

    Corrected Syntaxt :

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

    Reply
    • 1. How to test a form with multiple set of test data for the field validation of the form ?

      2. How to decide which framework is require if we are establish a new automation project ?

      3. How can we show the reports on the dashboard for grapchical representation?

      4. How can we handle the dateselection from calender dynamically, there is a date validation can’t select past date or future date ?

      Reply
  66. I have a question, I am able to input value in a text area using Selenium IDE but not able to input value using webdriver (Java). Is there any solution ? Please help.

    Reply
  67. I realy like the post and since I have some basic understanding of selenium. So i was able to link every answer with my understanding.
    Look forward for more such articles.

    Reply
    • for example the value is ” gbqfba ” right ! if it is displayed in the webpage we can use the displayed method

      same if it is selected .isSelected method

      Reply
  68. Hi,

    Nice post, I would also like to add few interview questions which i have faced in recent times

    – Cross browsing
    – Connections to Database
    – Window Handling’s
    – About Framework
    – About Cont Integration tool and build tools
    – challenges

    Reply
  69. about popups interview questions
    and different frame works where it will be used and type of questions in read excel and write excel questions

    Reply
  70. Could you please make a video for how to read the excel file. Also, when you call TestNG a framework than what is the difference between TestNG framework and regular framework.

    Could you please give example of implicit and explicit wait.

    Reply
  71. please please answer to this question …i need this to night bcoz i hv interview tomorrow..
    Qus: how reporting done in automation??
    Qus2:what are the build in tools use in automation??

    Reply
  72. Hi Team,

    Thanks for your efforts.
    I had a query which i faced during an interview, he asked me that if a web element is not having any locators or many of web elements are having same attributes. Then how to retrieve the information of a particular element.

    Reply
  73. Q #3) Why should Selenium be selected as a test tool?
    we should also add the customer demand is web based software interface which is also a trend in software industry now days. And selenium supports web based applications.

    Reply
  74. Earlier, I was not comfortable giving interviews. I guess most of you must be facing the same problem. However, after reading answers to most popular selenium interview questions, I became more confident and comfortable.

    Reply
  75. There is a conflict in Q48.

    it should be as:
    “WebDriver cannot test Mobile applications. WebDriver is a web based testing tool, therefore applications on the mobile browsers can not be tested.”

    And Nice article

    Reply
  76. Hi

    One correction in Question #34

    assertTrue(“The title of the window is incorrect.”,driver.getTitle().equals(“Title of the page”));

    this line should use asserEquals(“…

    Reply
  77. Thanks very much!believe me answered all my interview question from this blog as far as selenium concerened!

    Keep it up admin!

    Reply
    • they are four
      selenium IDE (integrated development environment )
      selenium RC ( remote control )
      selenium webdriver ( is the latest version of selenium tool )
      selenium grid

      Reply
  78. what is the major difference in between relative vs absolute xpath..
    For example:
    ……………………….
    1st time my xpath is—->.//*[@spellcheck=’false’]
    this case it will be shown 2matching nodes..and second time i’m filtering this xpath to—>
    .//*[@spellcheck=’false’][@id=’Email’]…this time i have only one matching node so i can say this is absolute…!

    Reply
  79. In Question number 32
    • void dismiss() – The accept() method clicks on the “Cancel” button as soon as the pop up window appears.

    it should be :
    void dismiss() – The dismiss() method clicks on the “Cancel” button as soon as the pop up window appears.

    Reply
  80. Nice article !!
    But there is one major part is missing that is data driven testing in detail :
    1. Using .csv file
    2. Data provider
    3. Using excel file

    Reply
  81. Hi,
    I want to use WebDriver driver object in two or more class without opening more browser open.Also any body provide the format of TestNG code as per above mention.
    ::
    more class use same driver same browser with testng annotation

    Reply
  82. Please correct the ans of Q #22) How can you find if an element in displayed on the screen?

    isDisplayed()
    isSelected()
    isEnabled()

    Syntax error please use isSelected() in the place of isDisplayed() :
    isSelected():
    boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();

    Reply
  83. Really Great work carried by software testing help team !!!!! keep it up the good work!!!
    Articles were really helpful.

    Thank you very much 🙂

    Reply
  84. Very good and useful information on various concepts.
    Please do the corrections as per the suggestions related to question 48 and others (if appropriate). The answer should be “….therefore applications on the mobile browsers cannot be tested.” Thanks.

    Reply
  85. Q #1) What is Automation Testing?

    Automation testing or Test Automation is a process of automating the manual process to test the application/system under test. Automation testing involves the use of a separate testing tool which lets you create test scripts which can be executed repeatedly and doesn’t require any manual intervention.

    I have different aspect of looking at above question. Automation Testing is validating the system test scenarios using the automated test scripts. It is not all about automating manual process because what if there is no manual process. It not about what we are doing, its about the definition Automation testing i.e validating the system using automated test scripts.

    So in the same way, as we say for manual testing is validating the test scenario manually.

    Reply
  86. There is one correction in a part of Q.No. 25. It says that “navigate().to() – This command lets the user to launch a new web browser window and navigate to the specified URL.”

    Correction: navigate().to() doesn’t always open a new window. If browser is already opened, it just navigate to the specified URL in the same open window.

    Reply

Leave a Comment