Top 10 Selenium Interview Questions


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 use to a separate testing tool which lets you create test scripts which can be executed repeatedly and doesn’t require any manual intervention.

What is Selenium and what is composed of?

Selenium is a suite of tools for automated web testing. It is composed of:
  1. 1- Selenium IDE (Integrated Development Environment): It is a tool for recording and playing back. It is a firefox plugin
  2. 2- WebDriver and RC: It provide the APIs for a variety of languages like Java, .NET, PHP, etc. With most of the browsers Webdriver and RC work.
  3. 3- Grid: With the help of Grid you can distribute tests on multiple machines so that test can be run parallel which helps in cutting down the time required for running in browser test suites

What are the testing types that can be supported by Selenium?

For web based application testing selenium can be used:

The test types can be supported are:

  1. a) Functional, Learn More about Functional Testing.
  2. b) Regression.

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

  1. a) Jenkins.
  2. b) Hudson.
  3. c) Quick Build.
  4. d) CruiseCont.

What are the limitations of Selenium?

Following are the limitations of Selenium:

  • Selenium supports testing of only web based applications
  • Mobile applications cannot be tested using Selenium
  • Captcha and Bar code 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 though the user can find numerous helping communities.
  • User is expected to possess prior programming language knowledge.

List out different types of locators?

Different types of locators are:

  • By.id()
  • By.name()
  • By.tagName()
  • By.className()
  • By.linkText()
  • By.partialLinkText()
  • By.xpath
  • By.cssSelector()

What is difference between assert and verify commands?

Assert: Assert command checks whether the given condition is true or false. Let’s say we assert whether the given 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 would stop and no further test would be executed.

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

How can we handle windows based pop up?

Selenium is an automation testing tool which supports only web application testing, that means, it doesn’t support testing of windows based applications. However Selenium alone can’t help the situation but along with some third party intervention, this problem can be overcome. There are several third party tools available for handling window based pop ups along with the selenium like AutoIT, Robot class etc.

Mention what is the difference between Implicit wait and Explicit wait?

Implicit Wait: Sets a timeout for all successive Web Element searches. For the specified amount of time it will try looking for element again and again before throwing a NoSuchElementException. It waits for elements to show up.
Explicit Wait: It is a one-timer, used for a particular search.

Explain what is the difference between find elements () and find element ()?

find element (): It finds the first element within the current page using the given “locating mechanism”. It returns a single WebElement

findElements () : Using the given “locating mechanism” find all the elements within the current page. It returns a list of web elements.

Explain what are the limitations of Selenium IDE?

The limitations of Selenium IDE:

  • Exceptional handling is not present
  • Selenium IDE uses only HTML languages
  • External databases reading is not possible with IDE
  • Reading from the external files like .txt, .xls is not possible
  • Conditional or branching statements execution like if,else, select statements is not possible
selenium testing selenium