Selenium Interview Questions – Set 02

List some of the test types that are supported by Selenium.

Different types of testing’s that we can achieve through Selenium are.

  • Functional Testing
  • Regression Testing
  • Sanity Testing
  • Smoke Testing
  • Responsive Testing
  • Cross Browser Testing
  • UI testing (black box)
  • Integration Testing

What is the main disadvantage of implicit wait?

The main disadvantage of implicit wait is that it slows down test performance.

Another disadvantage of implicit wait is:

Suppose, you set the waiting limit to be 10 seconds, and the elements appear in the DOM in 11 seconds, your tests will be failed because you told it to wait a maximum of 10 seconds.

What do you mean by the assertion in Selenium?

The assertion is used as a verification point. It verifies that the state of the application conforms to what is expected. The types of assertion are “assert”, “verify” and “waitFor”.

What are the popular programming languages supported by Selenium WebDriver to write Test Cases?

Selenium WebDriver supports the below languages to write Test Cases.

  • JAVA
  • PHP
  • Python
  • C#
  • Ruby
  • Perl

What is Selenium IDE?

Selenium IDE is implemented as Firefox extension which provides record and playback functionality on test scripts. It allows testers to export recorded scripts in many languages like HTML, Java, Ruby, RSpec, Python, C#, JUnit and TestNG.

Selenium IDE has limited scope, and the generated test scripts are not very robust, and portable.

What are the benefits of Automation Testing?

Benefits of Automation testing are as follows.

  • It allows execution of repeated test cases
  • It enables parallel execution
  • Automation Testing encourages unattended execution
  • It improves accuracy. Thus, it reduces human-generated errors
  • It saves time and money.

Explain the difference between assert and verify commands?

Assert: Assert command checks if the given condition is true or false. If the condition is true, the program control will execute the next phase of testing, and if the condition is false, execution will stop, and nothing will be executed.

Verify: Verify command also checks if the given condition is true or false. It doesn’t halt program execution, i.e., any failure during verification would not stop the execution, and all the test phases would be executed.

What do you mean by XPath?

XPath is also defined as XML Path. It is a language used to query XML documents. It is an important approach to locate elements in Selenium. XPath consists of a path expression along with some conditions. Here, we can easily write XPath script/query to locate any element in the webpage. It is developed to allow the navigation of XML documents. The key factors that it considered while navigating are selecting individual elements, attributes, or some other part of an XML document for specific processing. It also produces reliable locators. Some other points about XPath are as follows.

  • XPath is a language used for locating nodes in XML documents.
  • XPath can be used as a substitute when you don’t have a suitable id or name attribute for the element you want to locate.
  • XPath provides locating strategies like:
  • XPath Absolute
  • XPath Attributes

What is the difference between type keys and type commands?

TypeKeys() will trigger JavaScript event in most of the cases whereas .type() won’t.

What do you mean by Selenese?

Selenium commands, also known as “Selenese” are the set of commands used in Selenium that run your tests. For example, command – open (URL); launches the desired URL in the specified browser and it accept both relative and absolute URLs.

A sequence of Selenium commands (Selenese) together is known as a test script.