Selenium Pitanja
Selenium Pitanja
• Selenium IDE (Integrated Development Environment) : It is a tool for recording and playing back.
It is a firefox plugin
• WebDriver and RC: It provide the APIs for a variety of languages like Java, .NET, PHP, etc.
With most of the browsers Webdriver and RC works.
• Grid: With the help of Grid you can distribute tests on mul�ple machines so that test can be run parallel
which helps in cu�ng down the �me required for running in browser test suites
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
• A�ribute
• CSS
• Linktext
• Par�alLink Text
• Xpath etc
For post release valida�on with con�nuous integra�on automa�on tool could be used
a) Jenkins
b) Hudson
c) Quick Build
d) CruiseCont
4) Explain what is asser�on in Selenium and what are the types of asser�on?
Asser�on is used as a verifica�on point. It verifies that the state of the applica�on conforms to what is expected.
The types of asser�on are “assert” , “verify” and “waitFor”.
X-Path is used to find the WebElement in web pages. It is also useful in iden�fying the dynamic elements.
6) Explain the difference between single and double slash in X-path?
Single slash ‘/ ’
TypeKeys() will trigger JavaScript event in most of the cases whereas .type() won’t. Type key populates the value
a�ribute using JavaScript whereas .typekeys() emulates like actual user typing
• Assert: Assert allows to check whether an element is on the page or not. The test will stop on the step
failed, if the asserted element is not available. In other words, the test will terminated at the point where check
fails.
• Verify: Verify command will check whether the element is on the page, if it is not then the test will carry on
execu�ng. In verifica�on, all the commands are going to run guaranteed even if any of test fails.
10) What is JUnit Annota�ons and what are different types of annota�ons which are useful?
In JAVA a special form of syntac�c meta-data can be added to Java source code, this is know as Annota�ons.
Variables, parameters, packages, methods and classes are annotated some of the Junit annota�ons which can be
useful are
• Test
• Before
• A�er
• Ignore
• BeforeClass
• A�erClass
• RunWith
11) While using click command can you use screen coordinate?
To click on specific part of element, you would need to use clickAT command. ClickAt command accepts element
locator and x, y co-ordinates as arguments-
13) Why testers should opt for Selenium and not QTP?