1. What is Selenium ?
--> Selenium is a portable software testing framework for web applications.
The tests can be written as HTML tables or coded in a number of popular programming languages and can be run directly in most modern web browsers.
Selenium operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.
Selenium can be deployed on Windows, Linux, and Macintosh.
Selenium is used for UAT (User Acceptance Test)
2. Why and When To Automate?
-->Frequent regression testing
Repeated test case Execution is required
User Acceptance Tests
Faster Feedback to the developers
Reduce the Human Effort
Test same application on multiple environments
3. What are the Components of Selenium ?
-->Selenium IDE
Selenium Remote Control
Selenium Grid
4. Explain about Selenium-IDE ?
-->Selenium IDE is an integrated development environment for Selenium tests.
Operates as a Firefox add-on and provides an interface for developing and running individual test cases or entire test suites.
Selenium-IDE has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back.
It also has a context menu (right-click) integrated with the Firefox browser, which allows the user to pick from a list of assertions and verification for the selected location.
Offers full editing of test cases.
Although it is a Firefox only add-on, tests created in it can also be run against other browsers by using Selenium-RC & specifying the name of the test suite on the command line.
5. What are the Features of Selenium IDE ?
-->Record and playback
Intelligent field selection will use IDs, names, or XPath as needed
Auto complete for all common Selenium commands
Walk through test cases and test suites.
Debug and set breakpoints
Save tests as HTML, Ruby scripts, or other formats
Support for Selenium user-extensions.js file
Option to automatically assert the title of every page
Roll up common commands
6. What is Selenium-RC (Remote Control) ?
-->Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. Selenium-RC allows the test automation developer to use a programming language for maximum flexibility and extensible in developing test logic.
For instance, if the application under test returns a result set, and if the automated test program needs to run tests on each element in the result set, the programming language’s iteration support can be used to iterate through the result set, calling Selenium commands to run tests on each item.
7. Explain about Selenium-Grid ?
-->Selenium-Grid allows the Selenium-RC solution to scale for test suites or test suites to be run in multiple environments.
With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are sent to the hub they are then redirected to an available Selenium-RC, which will launch the browser and run the test.
This allows for running tests in parallel, with the entire test suite theoretically taking only as long to run as the longest individual test.
8. What are the Selenese Commands in Selenium ?
c-->licking a link - click or clickAndWait commands
entering values - type command
selecting options from a drop-down listbox - select command
clicking checkboxes or radio buttons - click command
What is Test Runner ?
Test Runner allows you to run the test case in a browser loaded with the Selenium-Core TestRunner. Test runner is invoked by clicking the below Shown button in the IDE.
9. What are the Running Options in Selenium ?
-->Run a Test Case: Click the Run button to run the currently displayed test case.
Run a Test Suite: Click the Run All button to run all the test cases in the currently loaded test suite.
Stop and Start: The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume.
Stop in the Middle: Set a breakpoint in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, select a command, right-click, and from the context menu select Toggle Breakpoint.
Start from the Middle: We can set the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a start point, select a command, right-click, and from the context menu select Set/Clear Start Point.
Run Any Single Command: Double-click any single command to run it by itself. This is useful when writing a single command. It lets you immediately test a command you are constructing, when you are not sure if it is correct. You can double-click it to see if it runs correctly. This is also available from the context menu.
10. What are the Assertion Statements in Selenium ?
-->assertTextPresent : This will assert if the text is present in the page.
assertText: This will assert if a particular element is having the particular text.
assertTitle: This will assert if the page is having a proper title.
assertValue: This will assert if a Text box or check box has a particular value
assertElementPresent: This will assert if a particular UI Element is present in the page.
11. Explain Selenium WaitFor Commands ?
-->waitForPageToLoad : This command will make the script to wait till the page loads.Syntax is waitForPageToLoad(timeout); Time out is the maximum time the script will wait for the page to load.
waitForAlert : This command will wait for the alert message to appear
waitForTable: This command will wait for the Web table to completely load in the page
waitForTitle: This command will for the page Title to appear on the browser.
Other waitFor commands : Selenium has several other wait command like waitForText,waitForPopup and so on. These commands are generically called Synchronization commands
12. What are the Advantages and Disadvantages of Selenium ?
-->Advantages
Supports C#, Java, PHP, Perl, Phython
Supported on Windows, Linux and Mac OS
Highly active developer community - backed by Google
Powerful methods to locate elements (Xpath, CSS, DOM)
Disadvantages
Challenges running on browsers other than Firefox
Difficulty to automate AJAX
Limitations to automate Applets, MS and Desktop Applications