E N D
Selenium IDE Installation and Use
Selenium Who? “Selenium IDE is an integrated development environment for Selenium scripts. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run. “
Installing the Selenium IDE plug-in • Open Firefox. • Navigate to http://seleniumhq.org/download/. • Download the latest version of Selenium IDE (currently version 1.9). • Firefox should show you the following warning: • Click the Allow button.
You’ll then see the following window: • Click the Install Now button.
You’ll then see the following window: • Click the Restart Now button. Firefox will restart.
To verify that you have Selenium IDE installed, open the Selenium IDE window by one of two methods: • Keyboard: Control-Alt-s • In the Firefox menu, Choose options Web Developer …Selenium IDE
If Selenium is installed correctly, the Selenium plug-in window should pop-up. the Selenium plug-in
Recording a script The record button The record button is on by default. Click it to turn recording off.
How to record a Selenium Test Script • In Firefox, navigate to the OLE function you wish to test • Start the Selenium plug-in • Make sure the Selenium record button is On. • Begin using the OLE function. • Selenium will begin recording your commands…
As you enter commands into the web browser, Selenium will record them… Recorded commands
While recording your script, you can right click on screen elements to reveal more Selenium commands. For example, clicking on item ‘verifyTextPresent Borrower Type Name’ will add a line to your script that verifies that that text is present on the page.
Saving your script • When you are finished testing your OLE function, click the red record button to stop recording. The record button
Save your script to a known file location (I suggest your desktop) by • using the keyboard combination of control-s • entering the File menu and selecting option Save Test Case.
Please use a filename of the form OLETS <issue number> -<name of issue.> For example: “OLETS118-OLE Borrower Type maintenance document.html”
Playing your script • After recording your test script, you can play it back to check if it properly repeats your test scheme. • Don’t be surprised if your script fails! Success or failure is not that important at this point. • The toolbar contains buttons for controlling the execution of your test cases, including a step feature for debugging your test cases.
Speed Control: controls how fast your test case runs. Run All: Runs the entire test suite when a test suite with multiple test cases is loaded. Run: Runs the currently selected test. When only a single test is loaded this button and the Run All button have the same effect. Pause/Resume: Allows stopping and re-starting of a running test case. Step: Allows you to “step” through a test case by running it one command at a time. Use for debugging test cases.
As the plug-in steps through your script, success and error messages will appear in the Log window. The Log Window
Attaching your Test Script to an OLETS issue • On your OLETS issue page, locate the attachments control • Click the cross, and the Attach Files dialog will appear. Use the Browse button to Locate your saved test script, And the Attach button to attach It to the OLETS issue.
When you run Selenium, you may notice: • Selenium suppresses pop-up error messages during recording and play-back. • Selenium may open a new window instead of a new tab during recording and play-back. • While Selenium is open, scroll-bars may disappear from some interfaces.
Once attached, your test script will appear in the Attachments area on the OLETS issue page.
Adding Comments to your Test Scripts • Everyone loves comments! • Adding comments makes your scripts more understandable to those who have to use or edit them later. • Use comments to
Adding Comments (continued) • After you have recorded and saved your test script, examine the commands listed in the right-hand column of the Selenium window.