What is Selenium and what is composed of?
Selenium is a suite of tools for automated web testing. It is composed of
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 multiple machines so that test can be run parallel which helps in cutting down the time required for running in browser test suites
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
What is Selenium 2.0 ?
Web testing tools Selenium RC and WebDriver are consolidated in single tool in Selenium 2.0
What is the difference between type keys and type commands ?
TypeKeys() will trigger JavaScript event in most of the cases whereas .type() won’t. Type key populates the value attribute using JavaScript whereas .typekeys() emulates like actual user typing
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
What are the advantages of Selenium?
It supports C#, PHP, Java, Perl, Phython
It supports different OS like Windows, Linux and Mac OS
It has got powerful methods to locate elements (Xpath, DOM , CSS)
It has highly developer community supported by Google
What are the four parameter you have to pass in Selenium? Four parameters that you have to pass in Selenium are
Host
Port Number
Browser
URL
What is heightened privileges browsers?
The purpose of heightened privileges is similar to Proxy Injection, allows websites to do something that are not commonly permitted. The key difference is that the browsers are launced in a special mode called heightened privileges. By using these browser mode, Selenium core can open the AUT directly and also read/write its content without passing the whole AUT through the Selenium RC server.
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.
Explain what is Datadriven framework and Keyword driven?
Datadriven framework: In this framework, the test data is separated and kept outside the Test Scripts, while test case logic resides in Test Scripts. Test data is read from the external files ( Excel Files) and are loaded into the variables inside the Test Script. Variables are used for both for input values and for verification values.
Keyworddriven framework: The keyword driven frameworks requires the development of data tables and keywords, independent of the test automation. In a keyword driven test, the functionality of the application under test is documented in a table as well as step by step instructions for each test.
Explain how Selenium Grid works?
Selenium Grid sent the tests to the hub. These tests are redirected to Selenium Webdriver, which launch the browser and run the test. With entire test suite, it allows for running tests in parallel.
What is Object Repository ?
An object repository is an essential entity in any UI automations which allows a tester to store all object that will be used in the scripts in one or more centralized locations rather than scattered all over the test scripts.
Mention what are the capabilities of Selenium WebDriver or Selenium 2.0 ?
WebDriver should be used when requiring improvement support for
Handling multiple frames, pop ups , multiple browser windows and alerts
Page navigation and drag & drop
Ajax based UI elements
Multi browser testing including improved functionality for browser not well supported by Selenium 1.0
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
Explain how you can switch back from a frame?
To switch back from a frame use method defaultContent()
Syntax-driver.switchTo().defaultContent();
Explain how you can use recovery scenario with Selenium?
Recovery scenarios depends upon the programming language you use. If you are using Java then you can use exception handling to overcome same. By using “Try Catch Block” within your Selenium WebDriver Java tests
What is Selenese and what are the types of Selenese ?
Selenese is a selenium set of command which are used for running the test
There are three types of Selenese
Actions: It is used for performing the operations and interactions with the target elements
Assertions: It is used as a check points
Accessors: It is used for storing the values in a variable
Explain what are the limitations of Selenium IDE?
The limitations of Selenium IDE
Exceptional handling is not present
Selenium IDE uses only HTML languages
External databases reading is not possible with IDE
Reading from the external files like .txt, .xls is not possible
Conditional or branching statements execution like if,else, select statements is not possible
What are the two modes of views in Selenium IDE ?
Either Selenium IDE can be opened as a pop up window or in side bar
In selenium IDE what are the element locators that can be used to locate elements on web page?
In selenium there are mainly 4 locators that are used
X-path locators
Css locators
Html id
Html name