Top 15 Selenium Web driver Automation Testing Interview Questions and Answers

James Warner
5 min readAug 25, 2020

Q1. What is Automation Testing?

A: Automation testing is a process of automating the manual test cases of the application under test. Automation testing involves the use of a Test Automation tool, which allows you to create test automation scripts that can execute periodically and without having much manual or human intervention.

Q2. What are the main benefits of Automation Testing?

A: Benefits of Selenium automation testing are:

  • Automation Supports Test execution of repeated test cases
  • Automation Enables you to support parallel execution
  • It encourages unattended execution without anyone sitting in front of the system.
  • It also Improves accuracy & efficiency by reducing errors due to human negligence.
  • Automation Saves time, money & efforts to complete the monotonous task.
Selenium automation testing questions

Q3. What is the Automation testing life cycle?

A: The Automation test life cycle contains a specific process. Here we discuss certain phases that come under the Test Automation life cycle.

  • Automation feasibility analysis
  • Test Plan/Test Design
  • Environment & Test lab setup
  • Test Script development for Test cases selected for Automation
  • Test script execution
  • Analyses of generated Test result

Q4. What is Selenium? What are the different Selenium components or Architecture?

A: SELENIUM is a free & open-source automated testing tool that is used to authenticate or test web-based applications across various browsers and platforms like Chrome, IE, Safari, Opera, etc. Also, Selenium supports & allows you to use multiple programming languages like Java, C#, Python, Ruby, etc. to create your Test Automation Scripts.

Selenium contains multiple components of the software. It has integrated for various uses to perform your Testing. Here are some components Selenium architecture:

  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • Selenium WebDriver
  • Selenium Grid

Q5. What kind of testing types Selenium supports?

A: Selenium allows & supports the following types of Testing:

  • Functional Testing
  • Regression Testing
  • Smoke Testing

Q6. What are certain limitations of Selenium & what functionalities cannot be automated by using Selenium?

A: There are certain limitations of Selenium software:

· Selenium only supports the Testing of web-based applications but not like windows & applications built on other technologies like QTP supports Desktop, Java, Oracle, SAP applications.

  • To Test the Mobile-based applications, we need another tool like Appium.
  • Functionalities looks like Captcha or Barcode readers cannot be tested using Selenium.
  • For better Report Generation, have to integrate third-party tools like TestNG or JUnit.
  • Like other Paid Tools, UFT & all Selenium does not provide any vendor support.

Q7. What is the language which Selenium uses to understand commands?

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

Q8. What are the various types of Element locators in Selenium?

A: The various element locator that identifies a web element uniquely within the webpage. To identify web elements accurately and exactly, we have different types of locators in Selenium:

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

Q9. What is the difference in Assert vs. Verify command in Selenium?

A: Assert command analyses whether the given condition is true or false. We assert whether the read element is present on the web page or not. If the condition is True, then program control executes the next step, but if the condition is false, the Test execution stops, and no further test gets executed.

Verify command also monitors whether the given condition is True or False. Despite the condition being true or false, the program execution doesn’t halt & stops in-between. In case of any failure during verification would not stop the execution, and all the test steps gets executed.

Q10. What is the XPath in Selenium?

A: XPath is an XML path of the web application. It is a syntax or address to find any element on a web page using the XML path expression. XPath is used to find the location or address of any Element/WebElement on a webpage using HTML DOM(Document Object Model) structure.

Syntax for XPath:

XPath includes the path of the element located on the web page. Syntax for creating XPath is.

Xpath=//tagname[@attribute=’value’]

Selenium automation Interview questions answer

Q11. What are the Types of X-path? What is Absolute XPath & Relative XPath?

A: Xpath in Selenium is of two types.

1) Absolute XPath

2) Relative XPath

Absolute XPath:

Absolute XPath is the direct method to find the web element on the webpage, but the difficulty of the absolute XPath is that if there are any modifications done in the path of the web element, then that XPath gets failed.

XPath begins with the single forward-slash(/), which indicates you can select the element from the root node.

html/body/div[1]/section/div[1]/div/div/div/div[1]/div/div/div/div/div[3]/div[1]/div/h4[1]/b

Relative XPath:

Relative Xpath begins from the middle of the HTML DOM (Document object model) structure. Relative XPath starts with the double forward-slash (//), which indicates it can search the web element anywhere on the webpage. You can begin your search from the middle of the HTML DOM structure and no need to write lengthy XPath.

Relative xpath Syntax example:

//*[@class=’featured-box’]//*[text()=’Testing’]

Q12. What is the difference between Single Slash “/” and Double Slash “//” in the Xpath?

A: We use Single Slash “/” to create Xpath with an absolute path, i.e., the XPath gets created to start a select path from the document start node.

We use Double Slash “//” to create Xpath with the relative path, i.e., the XPath gets created to start select path from anywhere within the document.

Q13. What is the purpose of using Selenium Grid?

A: Selenium Grid is used to execute the same or different test automation scripts on multiple platforms and browsers simultaneously to achieve allocated test execution, testing under different environments, and saving execution time exceptionally.

Q14. What are the methods and syntax to launch the different Browser using WebDriver?

A: Browsers can be launched into Selenium in the following ways:

WebDriver driver = new InternetExplorerDriver();

WebDriver driver = new ChromeDriver();

WebDriver driver = new FirefoxDriver();

WebDriver driver = new SafariDriver();

// Launch Website URL

driver.navigate().to(“http://www.google.com/");

Q15. What kind of Waits available in Selenium WebDriver?

A: Implicit Wait: Implicit waits provides a default waiting time (like 30 seconds) between each sequential test step across the entire running test script. The following test step would only execute when the given time like 30 seconds have elapsed after executing the previous test step.

Explicit Wait: We use Explicit waits to halt the execution time till a particular condition is match else the maximum time has elapsed. Explicit waits are applied for a particular instance only.

--

--

James Warner

Highly skilled and experienced Developer at NEX Softsys. He has an expert in Web & software development, customization and bright technology knowledge.