Categories
News

Selenium Interview Questions And Answers

Our experts providing  Selenium Testing  interview questions & Answers/Faqs can develop your carrier & knowledge to find the right job in a good MNC’s, doesn’t matter what kind of company you’re hired.

1)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.

2) What are the benefits of Automation Testing?

Benefits of Automation testing are:

Supports execution of repeated test cases
Aids in testing a large test matrix
Enables parallel execution
Encourages unattended execution
Improves accuracy thereby reducing human-generated errors
Saves time and money

3)Why should Selenium be selected as a test tool?

Selenium

is free and open source
have a large user base and helping communities
have cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.)
have great platform compatibility (Windows, Mac OS, Linux etc.)
supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.)
has fresh and regular repository developments
supports distributed testing

4)How will you find an element using Selenium?

In Selenium every object or control in a web page is referred as an elements, there are different ways to find an element in a web page they are

ID
Name
Tag
Attribute
CSS
Linktext
PartialLink Text
Xpath etc

5)List out the test types that are supported by Selenium?

For web based application testing selenium can be used

The test types can be supported are

a) Functional, Learn More about Functional Testing.

b) Regression

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

a) Jenkins

b) Hudson

c) Quick Build

d) CruiseCont

6)Mention what is the use of X-path?

X-Path is used to find the WebElement in web pages. It is also useful in identifying the dynamic elements.

7)Explain the difference between single and double slash in X-path?

Single slash ‘/ ’

Single slash ( / ) start selection from the document node
It allows you to create ‘absolute’ path expressions
Double Slash ‘// ’
Double slash ( // ) start selection matching anywhere in the document
It enables to create ‘relative’ path expressions

8)What is the 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 halt i.e. any failure during verification would not stop the execution and all the test steps would be executed.

9) What is JUnit Annotations and what are different types of annotations which are useful ?

In JAVA a special form of syntactic meta-data can be added to Java source code, this is know as Annotations. Variables, parameters, packages, methods and classes are annotated some of the Junit annotations which can be useful are

Test
Before
After
Ignore
BeforeClass
AfterClass
RunWith

10)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

11)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.

12)Explain what are the JUnits annotation linked with Selenium?

The JUnits annotation linked with Selenium are

@Before public void method() – It will perform the method () before each test, this method can prepare the test
@Test public void method() – Annotations @Test identifies that this method is a test method environment
@After public void method()- To execute a method before this annotation is used, test method must start with test@Before

13)What is the difference between close() and quit()?
The close() method closes the current browser only whereas quit() method closes all browsers opened by WebDriver.

14)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 appears in the DOM in 11 seconds, your tests will be failed because you told it to wait a maximum of 10 seconds.

15)Mention 5 different exceptions you had in Selenium web driver?

The 5 different exceptions you had in Selenium web drivers are

WebDriverException
NoAlertPresentException
NoSuchWindowException
NoSuchElementException
TimeoutException

16) How can you retrive the message in an alert box ?

You can use the storeAlert command which will fetch the message of the alert pop up and store it in a variable.

17) Explain what is the main difference between web-driver and RC ?

The main difference between Selenium RC and Webdriver is that, selenium RC injects javascript function into browsers when the page is loaded. On the other hand, Selenium Webdriver drives the browser using browsers built in support

18)What are the technical limitations while using Selenium RC?

Apart from “same origin policy” restriction from js, Selenium is also restricted from exercising anything that is outside browser.

19)Other than the default port 4444 how you can run Selenium Server?

You can run Selenium server on java-jar selenium-server.jar-port other than its default port

20)To enter values onto text boxes what is the command that can be used?

To enter values onto text boxes we can use command sendkeys()…….. For more  Click Here


For Course Content  Click Here