Wednesday, October 5, 2011

Selenium IDE

Overview of Selenium IDE

Selenium IDE features:
• record/play mechanism: create/edit tests by recording the user actions on the page
• Debugging feature with step-by-step and breakpoints
• Page abstraction capabilities
• Automatic assertions for the page title
• An extensibility feature allowing the use of plugins or user extensions that extend the capabilities of Selenium IDE

Presentation: How Selenium IDE look like

The interface features the following elements:
• An action bar to control the test (1)

Action bar has the following:
1.The base url of the application
2.Test speed
3.Run test-suite
4.Run the selected test case only
5.Pause the test
6.Next step (while paused only)
7.Open Selenium TestRunner
8.Apply rollups (see Section 9.5, “Rollups”)
9.Start/Stop recording

• A test-suite tool (2)
Shows the tests in the current test-suite along with the results.
• A test editor (3)


Test Editor has following sections:
1.The test steps
2.The command of the current step
3.The locator argument
4.‘Find’ button highlights the target of the locator on the page
5.The value argument
• A tool panel (4)


Tool Panel has following sections:

1.Log: shows the execution log of the current tests and displays errors
2.Reference: displays the documentation of the command actually selected
3.UI-Element: diplays the ui-element mappings actually in use
4.Rollup: shows rollup rules
5.Stored-vars : displays current stored variables
6.Log level (only with log panel): customize the verbosity of the log
7.Clear log (only with log panel): clears the log


Export Features


A most interesting feature of Selenium IDE: export to Selenium RC. Selenium IDE is able to export test cases in the following formats:
• Java (Junit 3/4 and TestNG)
• Groovy (Junit)
• C#
• Perl
• Python
• PHP
• Ruby (RSpec and Test/Unit)
You can export test-cases or the entire test-suite.


Installation
Selenium IDE is a Firefox extension:
1. Go to the Selenium website (http://www.seleniumhq.org) or the Firefox add-ons website (http://addons.mozilla.org)
2. Download the latest release of selenium IDE(1.0.8 at the time of writing)
3. Follow the instructions and restart Firefox
4. Selenium IDE is accessible from the ‘Tools’ Menu of Firefox

Example Excercise

1. Open Firefox, go to http://www.google.com. Then, open Selenium IDE (‘Tools’ → ‘Selenium IDE’)



2. Make sure the record button is activated, then type in the search field pizza.


3. Click anywhere on the page or press tab to validate the entry. The Selenium IDE window now looks like this:



4. Click the Google Search button. You can see the click command appear in the IDE.
•On the result page, do a right-click and select the assertTitle command:
5. The command appears in the IDE window

No comments:

Post a Comment