1. Do you know the difference between close and quit command?

If you need to close the current browser having focus driver.close() is used. If you need to close all the browser instances driver.quit() is used.

2. Do you know what is a data-driven framework?

The Data Driven test design framework follows a design paradigm where test logic is fixed but varies the test data. The data itself can be in different repositories like a simple .csv file, .json file or .xls sheet, or database and can add the tests merely updating those external files or DB (instead of placing in test code itself).

3. Tell me the fundamental difference between XPath and CSS selector?

Using CSS selector we can only move downwards in the document, using XPaths we traverse up in the document.

4. Tell us how can you create HTML test report from your test script?

There are three ways of HTML test report creation:

☛ using inbuilt default.html to get the HTML report in TestNG
☛ with the ANT help in JUnit
☛ using XSL jar for converting XML content to HTML in own customized reports

5. Tell us how can you run Selenium Server other than the default port 4444?

Selenium server could be run on java-jar selenium-server.jar-port other than its default port.

6. Tell us what is JUnit? And what is JUnit Annotation?

JUnit is an open source Java applications testing framework, introduced by Apache. A process of adding a special form of syntactic metadata to Java source code is called annotation. JUnit Annotations are: variables, parameters, packages, methods and classes.

7. Explain me what could be the cause of Selenium WebDriver test to fail?

There are some causes of Selenium WebDriver test to fail:

☛ SeleniumWebDriver element waiting to access did not appear on the web page and the operation timed out
☛ SeleniumWebDriver is trying to access not created element
☛ SeleniumWebDriver cannot locate the element, because the locator has been changed

8. Do you know what is a XPath?

XPath is a language that describes a way to locate and process items in Extensible Markup Language (XML) documents by using an addressing syntax based on a path through the document's logical structure or hierarchy.

9. Tell me do you know a way to refresh browser by using Selenium?

The list of commands to refresh a page in Selenium:

☛ navigate().refresh()
☛ getCurrentUrl()
☛ navigate().to(driver.getCurrentUrl())
☛ sendKeys(Keys.F5)

10. Tell us how will you use Selenium to upload a file?

File uploading action could be performed by using element.sendKeys("path of file") on the webElement of input tag and type file: < name="fileUpload" type="file" />

Download Interview PDF