1. What is Selenium?
Selenium is a free test automation framework to conduct software testing. It is mainly used to test web application. Selenium comes with easy navigation tools that can write test cases without the need for any script.2. What are the advantages of Selenium?
i. Selenium is an Open Source Software and it is free to use.ii. Selenium offers a user-friendly interface that helps create and execute tests easily and effectively
iii. It offers multiple programming languages support, namely Java, C#, Perl, Python, Ruby and PHP
iv. Test cases of Selenium can be executed on various OS such as Windows, Mac OS, Linux etc.
v. Selenium supports various Browsers. It allows running the same set of tests on different browsers
vi. With Selenium, we can reduce the Test execution Time as it supports Parallel Test Execution
vii. Selenium requires less Hardware resources
viii. Selenium Test Automation can be implemented for Mobile web application automation on Android, IPhone, and Blackberry
ix. Selenium has a large user base and helping communities
3. What are the shortcomings of Selenium?
i. Selenium can be used only to test web application.ii. Selenium has limited support for image testing. For image based testing, we need to integrate Selenium with Sikuli.
iii. Selenium doesn't offer reliable technical support.
iv. Selenium WebDriver doesn’t have built in Result Report facility, we need to take help from either JUnit or TestNG Testing Framework to generate Test Reports
4. What is Selenium WebDriver? Is Selenium Web Driver Automation Tool?
Selenium Web driver is a set of class which is used to automate a web application. It is not an Automation tool.5. What kind of application is best suited for Selenium?
Selenium is used to automate web based application. It supports multiple languages such as java, C# and Python and have browser and Platform compatibility.6. What is Automation Testing?
Automation Testing or Test Automation means using software tool to run repeatable tests against the application to be tested. It is a process of automating the manual process to test the application, thereby reducing human-generated errors.7. What are the testing types that can be supported by Selenium?
Selenium supports the following types of testing:i. Functional Testing
ii. Regression Testing
8. Explain the Selenium Test Life Cycle.
a. Test Plani. Acquire application environment details such as UI Design technology, database etc. from development team
ii. Analyze the Application Under Test in terms of Object Identification.
iii. Select Test Cases for automation
iv. Select and implementation of framework
b. Generate Test Cases
c. Run and Debug Test
Running or executing the tests is mandatory at this phase. No need for debugging if the test case does not show any errors and providing the right output.
d. Analyzing Test Results and Report Defects
Selenium provides only a summary of test results. It doesn’t provide detailed test reports, but using either JUnit or TestNG we can get detailed Test Reports.
9. How do you build object repository in your project?
Object repository is a collection of objects. It allows a tester to store all objects in one or more centralized locations.In selenium, we call objects as locators such as ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, XPath and CSS.
And the best way to create Object Repository is to use Page Object Model
10. Explain the difference between Borland Silk and Selenium.
Borland Silk test is used for client server applications whereas Selenium is used for only web application.Silk test uses test scripting language whereas Selenium can use many languages like Java, Ruby,Perl and so on.
Borland Silk test is not a free testing tool whereas Selenium is completely free test automation tool
11. What are the different exceptions in Selenium WebDriver?
Here are some of the most common exceptions in Selenium Webdriver:TimeoutException - This is thrown when a command performing an operation doesn't complete in enough time
NoSuchElementException - This is thrown when Webdriver is unable to identify the elements during runtime
ElementNotVisibleException - This is thrown when the element is present in DOM but not visible on the web page
StaleElementException - This is thrown when the element is no longer present on the DOM page
12. How to Handle Exceptions in Selenium Webdriver?
To handle exceptions, a try/catch block is placed around the code that might generate an exception.13. What is exception test in Selenium?
An exception test refers an exception that we expect will be thrown inside a test class. We use the @Test annotation that specifies which exception will be expecting by mentioning it in the parametersExample
@Test(expectedException = ElementNotVisibleException.class)
14. What is POM (Page Object Model)? What are its advantages?
Page Object Model is a design pattern for creating an Object Repository for web UI elements. In the Page Object Model Design Pattern, each web page is represented as a class. All the objects related to a particular page of a web application are stored in a class.Page Object Model is widely used design pattern in Selenium for enhancing test maintenance and reducing code duplication.
Here are few Advantages:
i. We can achieve code reusability using POM by writing the code once and use it for different tests later.
ii. POM makes the clear difference between the test code and page specific code like locators and the layout. This approach makes the maintenance of code easy.
iii. POM improves the overall readability of the code by separating page specific code with the test code.
15. What is Page Factory?
Page factory is the way to implement page object models. It is class provided to support the Page Object design pattern. It enables to initialize web elements you want to interact within the page object when you create an instance of it.16. Difference between Page Object Model(POM) and Page Factory?
Page Object is a class that represents a web page and holds the functionality and members.Page Factory is a way to initialize the web elements you want to interact within the page object when you create an instance of it.
17. What are the advantages of Page Object Model?
i. Code reusabilityii. Code Maintainability
iii. Object Repository
iv. Readability
18. What are the types of frameworks in Selenium?
There are mainly three types of frameworks created by Selenium WebDriver to automate manual test cases:Data Driven Test Framework
A data driven framework is one in which the test data is put in external files like csv, excel etc. separated from test logic. In this framework, input values are read from data files such as xls, XML, csv, and databases and are stored into a variable in test scripts.
Keyword Driven Test Framework
A keyword driven framework is one in which the actions are associated with keywords and kept in external files e.g. an action of launching a browser will be associated with keyword - launchBrowser()
Hybrid Test Framework
The hybrid framework is a mix of keyword driven and data driven framework.
19. Which files can be used as data source for different frameworks?
Some of the file types of the dataset can be: excel, xml, text, csv, etc.20. How to set the size of browser window using Selenium?
To maximize the size of browser window, you can use the following piece of code:driver.manage().window().maximize(); - To maximize the window
To resize the current window to a particular dimension, you can use the setSize() method.
21. How to take a screenshot in Selenium?
There are some of the scenarios we may need to capture screenshot using Selenium WebDriver such asi. Application issues
ii. Assertion Failure
iii. Difficulty to find Web elements on the web page
iv. Timeout to find Web elements on the web page
Syntax to capture and save the screendshot:
File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.File);
22. How to work with Excel files in Selenium?
Apache POI is widely used library in the industry to work with excel files in selenium.We can also use 'JXL' to work with excel files in Selenium.
23. What is Apache POI?
Apache POI is an open source library written in Java. It is developed and distributed by Apache Software Foundation to design or modify Microsoft Office files.This is the most common API used for Selenium data driven tests. Selenium does not support read and write operations on excel files. It uses third party APIs like Apache POI to read and write operations on excel files.
24. What is the difference between findElement and findElements?
findElement method is used to access a single web element on a page. It returns the first matching element.findElements method returns the list of all matching elements.
25. List out different types of locators?
A Locator in Selenium is used to find and match the elements of your page that it needs to interact with.Different types of locators are
ID - Select The Element
Name - Select The Matching Element
Link Text - Select The Link Element
Partial Link Text - Select Link Element
Tag Name - Find The Element
CSS Class Name - Access The Elements
CSS Selector - Access The Elements
XPath - Locate Elements
26. What is Selenese and what are the types of Selenese?
Selenese is a set of selenium commands which are used to test web application.Selenium commands are classified into 3 basic categories.
Actions: These commands change the state of the application like click on some link, select from options, select a value from drop down etc.
Assertions: It is used as a check points. It verifies the state of an application and compares against the expected.
Accessors: These commands check the state of the application and store the application state in some variable.
27. Why Selenium RC is used?
Selenium IDE supports only HTML language. Thus, it doesn't support many functions like condition statements, Iteration, unexpected error handling etc.To handle such issues Selenium RC is used. Selenium-RC offers APIs and libraries for all its supported languages such as Java, C#, HTML, Perl, Ruby, PHP, and Python.h2>28. What is selenium Grid?
Selenium Grid is an important tool of Selenium suite. It allows running tests on different machines against different browsers. It also reduces the time taken by the test suite to complete a test by running tests in parallel.
29. What are some advantages of selenium grid?
The advantages of selenium grid are:i. Selenium grid allows executing multiple test cases on different browsers and operating systems. This way tests can be executed in parallel and thereby saving test execution time
ii. It allows performing cross browser testing.
iii. It allows performing multiple OS testing.
iv. When a node is free, it automatically picks up the test case waiting in the execution queue
30. What is testNG? What are some advantages of testNG?
The NG stands for Next Generation. TestNG is an automation testing framework that can be integrated with selenium or any other automation tool to provide multiple capabilities like assertions, reporting, parallel test execution etc.Following are the advantages of TestNG:
i. With TestNG, it is possible to produce HTML Reports of execution
ii. It allows parallel execution of test cases.
iii. TestNG Annotations made testers life easy
iv. It enables to Group and Prioritize Test Cases more easily.
v. Generation of Log is made possible.
vi. Data Parameterization is possible that allows support for parameterizing Test Cases using @Parametersannotation.
No comments:
Post a Comment