Introduction to Selenium IDE
Selenium IDE is a plugin for Firefox that allows Quality Assurance representatives to test web based software or websites. It works similar to how macros work.
Installing Selenium IDE
- Using Firefox, go to the SeleniumHQ download page and under the Selenium IDE section, click the download link. (At the time of this writing there was a link to the released version as well as an unreleased version. I chose version 1.10.0.)
- Firefox will prompt you to install the plugin. Click Allow, then Install Now.
- Restart firefox.
- You are now ready to perform your first automated test.
Your First Automated Test in Selenium IDE
Prerequisite: Selenium IDE must be installed. (See above)
- Using Firefox, browse to the web application or web site you would like to test.
- Press CTRL-ALT-S to open Selenium IDE along-side of Firefox.
- You should see the web address from Firefox now showing at the top of Selenium IDE in the Base URL text box.
- Notice the red circle towards the top right. It is highlighted, indicating that it is "recording" your steps now.
- In Firefox, click a link on the web page.
- In Selenium IDE, you will see that it added the command to the list of commands.
- Click a few more links and watch them get added to the list.
- Stop the recording by clicking the red circle at the top right of Selenium IDE.
- Click the "Play current test case" button at the top of Selenium. (There are two green play buttons at the top. Click the one on the right. It is right next to the yellow Pause button.)
- You should see Firefox automatically load the web page and sequentially load all the pages corresponding to the links to clicked earlier.
- Control the speed of the playback by moving the Fast/Slow slider.
- Delete commands from the Command table by selecting one and pressing Delete.
- Move commands in the Command table by selecting one and dragging it to a new position.
- Edit a command by selecting one and modifying the text boxes below the table.
- If you close Firefox completely, then you will not be able to open it again until you close Selenium IDE. (At least that is the result I had when using Selenium IDE 1.10.0 with Firefox 18 on Windows 8. Results may differ on different configurations.)
- AssertTextPresent and VerifyTextPresent: Both commands check if the given text is found on the page. However, when using assertTextPresent the test will stop if the text is not found, whereas with verifyTextPresent, the test will show an error and will continue to the next command.
- Setting a Start Point: Choose a command in the middle of your list of commands. Press the S key to toggle the start point. (Or right-click and choose "Set / Clear Start Point".) A green arrow will appear to the left of that command. Now, anytime you click the "Play current test case" arrow at the top, it will start at that command instead of at the beginning. Press S again while that command is selected to remove the starting point that you added.
- Setting a Breakpoint: Choose a command in the middle of your list of commands. Press the B key to toggle the breakpoint. (Or right-click and choose "Toggle Breakpoint".) A yellow pause icon will appear to the left of that command. Now, anytime you run that test, it will stop at that breakpoint. To continue once it has stopped there, click the blue "Step" arrow at the top to move to the next command, or click the yellow and green "Pause / Play" arrow to continue through the rest of the commands automatically.