Selenium With Java Interview Questions

Showing 1 - 10 of 35 results

What is difference between relative XPath and absolute XPath?

Absolute XPath: Absolute XPath starts with the single slash. Using absolute XPath you will be covering the whole path to the element. It is the direct way to find the element and starts with a single slash which means you can select the element from the root node but the disadvantage of the absolute XPath is that if there are any changes made in the path of the element then XPath gets failed.

Here is an example to represent how to write an expression for absolute XPath:

What is difference between "/" and "//" ?

Single Slash "/": Single slash is used to create XPath with absolute path i.e. the XPath would be created to start selection from the document node/start node. Usually, absolute XPath starts with the single slash and you will be covering the whole path to the element. In other words, single slash starts to search exact next node of a particular node in HTML content.

What is XPath?

XPath is defined as XML path to locate the elements. It is a syntax for finding/locating any element on the web page using XML path expression.

XPath uses the HTML DOM structure that looks like XML Path expression. Using XPath, we could navigate through elements and their attributes through XML source code to locate web elements such as textbox, button, checkbox, image etc in the web page.

Various types of XPath:

  • Absolute XPath
  • Relative XPath

What are the Frameworks with respect to programming languages supported by Selenium WebDriver?

  • C#: Framework available (NUnit)
  • Java: Framework available (JUnit, TestNG)
  • JavaScript: Framework available ( WebdriverJS, WebdriverIO, NightwatchJS, NemoJS)
  • PHP: Framework available (Behat + Mink)
  • Python: Framework available(unittest, Robot framework, pyunit,py.test)
  • Ruby: Framework available (RSpec, Test:: Unit)

Which WebDriver implementation claims to be the fastest ?

The fastest implementation of WebDriver is the HTMLUnitDriver. It is because the HTMLUnitDriver does not execute tests in the browser and also called as a Headless browser.

It executes without a graphical user interface and gives a fast lightweight way to automate high-level user actions indulge in testing.

Subscribe to Selenium With Java Interview Questions