Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Selenium Testing Tools Interview Questions You'll Most Likely Be Asked: Second Edition

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Selenium Testing

ToolsInterview
Questions
Review these typical interview questions and think about how you would
answer them. Read the answers listed; you will find best possible answers
along with strategies and suggestions.
This page is intentionally left blank
Chapter 1

Generic Selenium

1: Explain Selenium exception test.


Answer:
The Exception test is expected to throw all exceptions that the
webpage is supposed to throw. A class that’s written to throw an
exception can handle the expected exception using the test
annotation clause. Remember that the exception has to be a .class.

2: Explain the various frameworks supported by Selenium.


Answer:
Selenium supports three types of frameworks – Data Driven,
Keyword Driven and Hybrid. The Data Driven framework uses an
external file such as excel, xml, csv, database etc. to build test cases.
The Keyword driven framework uses an external file to store the
keywords such as commands or operations. In a Hybrid framework,
the external file may have a combination of both keywords and data.

3: Explain the testing types that are supported by Selenium.


Answer:
You can do Functional, Regression and Load Testing using Selenium.
Functional testing checks the functionality of the software
application. Regression testing checks the functional and non-
functional aspects of the software after the software undergoes a
change to make sure that it still conforms to the client requirements.
Load testing is done to check how much load the software can
handle at its peak.

4: Explain the restrictions of Selenium.


Answer:
Selenium has the following restrictions:
a) You can only test applications that are web-based
b) You can’t test Mobile applications
c) Selenium does not support testing of Barcode readers and
Captcha
d) You need third party tools such as JUnit or TestNG to generate
reports.
e) Being free, you won’t get any vendor support
f) You need to be familiar with some programming language.

5: Explain Selenese Language.


Answer:
The Selenese language is used for writing Selenium IDE test scripts.
It is used like a programming language for writing test scripts that
run on Selenium.

6: Differentiate between driver quit and driver close.


Answer:
The driver close command closes the current browser window
running the command. The driver quit command is used to close all
browser windows opened by the program including the current one.

7: Differentiate verify and assert commands.


Answer:
Both Verify and Assert commands are used to check the result of a
given condition, whether true/false. While the Verify command does
not halt or pause the program irrespective of the status, the Assert
command will continue execution only if the condition returns true.
A verification failure doesn’t stop the program execution in case of a
Verify command. But while using the Assert Command, if the
condition is false, the rest of the conditions are not skipped.

8: What is the difference between find Element() and find


Elements()?
Answer:
While both the functions are used to fetch the web elements in a
page, there’s a subtle difference. The find Element() function is used
to find the first element on the webpage at the given locator. Find
Elements() will return all elements pointed by the locator.
9: Explain Windows based popups and how they are handled in
Selenium.
Answer:
Using Selenium automation tool, you can only test web applications.
It won’t handle Windows popups.

10: What are some practical risks with Selenium?


Answer:
Here are some of the issues with Selenium:
a) Selenium is good only for web-based solutions
b) No support extended for Bitmap comparison
c) Third party tools have to be depended upon for all types of
reporting requirements
d) Unlike the competing commercial tools, there’s no vendor
support
e) The absence of object source makes it a challenge to maintain
the objects

11: Explain the benefits of Selenium.


Answer:
a) It supports Python, C#, Java, PHP, Perl
b) It supports Linux, Mac OS and Windows
c) It has authoritative procedures to locate the DOM, CSS and
XPath elements
d) Highly regarded Google-supported developer community
12: Explain the four parameter you have to pass in Selenium.
Answer:
The four parameters that you have to pass when using Selenium are:
a) Host
b) Port Number
c) Browser
d) URL

13: Explain the Selenium testing tool.


Answer:
Selenium is an open-source tool primarily used for testing web
applications on different browsers. It is used to automate the tests
carried out on the web browser. Selenium is a pool of different tools
that can run on Windows, Mac and Linux. It supports multiple
programming languages and most of the popular browsers’ latest
version. Selenium tests can be developed using Visual Studio,
Eclipse or other IDEs. It has no formal support since it is an open
source tool. But there’s an open source community for Selenium that
offers complete support. It can work in sync with tools like JUnit and
TestNG to manage test cases and to generate reports. It can also
perform continuous testing with tools like Jenkins, Maven, & Docker.

14: How does Selenium differ from the rest of the browser
automation tools?
Answer:
a) Selenium, being an open source tool comes with zero license
cost whereas most of the other tools such as UFT, Test
Complete etc are paid ones. Hence, Selenium is appealing due
to the license or subscription fee incurred on commercial
automation tools.
b) Selenium tools provide support for customization, assuring
flexibility in terms of tool integration. For example, tools such
as TestNG and JUnit for managing test cases and generating
reports.
c) A custom-built framework offers ample control over the
features that are built into Selenium. It allows the addition of
new features to be built into the framework.
d) It is extensible to the extent that the source code can be
modified for integrations. In the case of UFT and Test
Complete, integration can be done only with the support
team’s help.

15: Explain the various tools available with Selenium.


Answer:
Selenium comes with a suite of tools, each catering to different
testing needs.
Selenium IDE: The IDE or Integrated Development Environment is
a plugin for Firefox browser which is mainly used to create and run
test cases that are generated in the IDE by recording [use the Record
button] the interactions/navigation of the expected user work flow
with the browser. Upon recording of the test cases, they can be re-
played multiple times. Further these test records can be exported to
diverse programming languages such as Ruby, Java, Python, etc.
This Plug-in is exclusively accessible for Firefox.
Selenium Grid: With the Grid, numerous test cases can be run
simultaneously on different machines. The Hub-Node arrangement
enables parallel execution. The Hub takes charge of the tests being
executed on different browsers with diverse operating systems. The
various node test scripts can be written using diverse programming
languages.
Selenium WebDriver: Each browser has its own driver on which the
application runs. However, Test Reports or Testing images cannot be
generated.

16: How do I choose the right Selenium tool?


Answer:
Selenium is generally used to automate web-based Functional test
cases and Regression test cases. The specific suite of Selenium tool to
use should depend on your application to test as well as your testing
purpose. Selenium IDE can be used for rapid testing of simple test
cases as it does not require any programming or scripting
knowledge. Use Selenium Grid if you have enormous test suites that
must be executed on multiple environments. Use Selenium
WebDriver to test AJAX-based applications, to generate personalized
test results and to perform tests on the Html Unit browser. Use
Selenium RC for cross-browser and cross-platform testing as well for
data driven testing.

17: Explain Selenium IDE.


Answer:
This is an interface that records and plays any Selenium workflow
action without the user having to know any programming or
scripting language. The IDE only supports Firefox as an addon for
the browser. Recording of the test case execution is carried out on
Firefox. It supports test case execution on other browsers with the
help of RC or WebDriver. The IDE is accountable for User Actions
that are recorded as they are implemented. These recordings can be
exported as reusable scripts to be executed later. Scripts are usually
recorded in HTML but can be converted to other supported
languages too. It also has a reporting module for test results.

18: Which language is supported by Selenium IDE?


Answer:
The default command in Selenium is written in HTML but other
programming languages such as C#, Java, Perl, PHP, Python and
Ruby are also supported.

19: What is Selenium 1.0?


Answer:
Selenium 1, also known as Selenium Remote control (RC), tool is
used for test automation. This tool can run automated tests for any
web application in any programming language. Currently Selenium
has client drivers for PHP, Python, Ruby, .NET etc that makes
running test cases easier. The benefit of using RC is that it allows the
use of remote browsers and reduces the need to change every line of
code with respect to the growing number of languages.

20: Explain Selenium 2.0.


Answer:
Selenium 2 is otherwise known as Selenium WebDriver which
combines the elements of Selenium Ver 1 and Web driver. Selenium
Ver 2.0 is a successor of Selenium Ver 1.0. It accepts a command as
sent in Selenium or through API and then sends it to the browser. So,
a browser-specific browser driver is used to send the results. Unlike
in Selenium Ver 1.0 where a server was required to run the tests,
Selenium web driver does not need a special server to execute tests.
The web driver will initiate the browser directly and will control the
test.
21: In what ways can you spot the elements on a web page with the
help of Selenium?
Answer:
Locators help to find the elements on Selenium IDE. Locator is a
critical factor while writing automation scripts to find the GUI
elements on the IDE. There are 8 locators in Selenium IDE that help
to locate various elements:
a) ID: Ids are unique and can spot an element instantly.
b) Name: Though names are not unique, it is easier to locate an
element using the name.
c) Identifier: The ID attribute is searched first and then the name
is searched with the Identifier.
d) DOM: The DOM locator locates the elements that match the
JavaScript expression.
e) XPath: When the element can be located in an XML Pack, use
the XPath locator.
f) Link: Use Link Text for locating the named links in the IDE.
g) CSS: The CSS Selectors help identify the element in the IDE.
h) UI: The page set UI elements help to map the element’s DOM
node and the page’s XPath.

22: What is the use of Selenium Grid?


Answer:
Grid is part of Selenium suite which can run tests simultaneously on
many machines. This ability to run tests simultaneously on multiple
machines is useful in spreading the load of testing across several
machines. Selenium grid is used primarily in cases when all the
browsers used for testing cannot run on the same platform.
This page is intentionally left blank

You might also like