After install selenium IDE, you are eager to know how to use it. Now we will introduce each selenium IDE element and its function.
1. How To Use Selenium IDE To Record Test Case Script Steps.
- When you click the selenium IDE extension button icon to open it, it will list some useful links in the popup window.
- The links contain Record a new test in a new project, Open an existing project, Create a new project, Close Selenium IDE.
- When you click the Record a new test in a new project link, it will popup the name your new project dialog, you can input the project name ( for example TestSeleniumIDE ) in the textbox, click the OK button.
- Then it will prompt the Set your project’s base URL dialog, you should input the base URL ( for example https://www.google.com ) in the textbox.
- Now you can click the START RECORDING button to record test scripts in selenium IDE.
- It will open a Google Chrome or Firefox web browser to browse the base URL, and there is a selenium IDE status button at the web browser bottom right corner to show what action is the selenium IDE doing.
- At the same time, the Selenium IDE window is active also, there are a lot of menus/buttons in it. When you click the Stop button ( on the top right corner of the Selenium IDE window ), it will pop up the Name your new test dialog, you can input the test name ( Test_1 ) in the textbox, click the OK button to save it.
- Now you can see the test name in the Selenium IDE window left side project Tests panel.
2. Selenium IDE Window Function Introduction.
- Click the test name on the left side Tests panel, it will list all the interactions that the tester runs with the web browser on the right side Test Script Detail panel.
- Each interaction line contains 3 columns.
- The Command column shows the tester action such as open, set window size, click, type, send keys.
- The Target column shows the web element XPath or CSS selector value, selenium use this value to select related web element.
- The Value column shows the user input values in the web page element ( for example input java in the google.com search box ).
- Click each interaction line will display the interaction properties in the panel below the interaction line list, you can modify the content of the Command, Target, or Value.
- If you want to run the current test script, you can select the test name in the left panel then click the Run current test button ( a triangle button ) on the top left corner of the Test Script Detail panel.
- If you want to insert interaction lines in your current test script, you can click right-click the interaction line, then click the Insert new command menu item in the popup menu list.
- You can also click the REC button on the top right corner of the selenium IDE window to record more interactions to the current test script.
- You can find a lot of menu items when you right-click one interaction line in the Test Script Detail panel on the Selenium IDE window right side.
- The menu items contain Cut, Copy, Paste, Delete, Insert new command, Clear all commands, Toggle breakpoint, Play to this point, Record from here, Play from here.
- The menu item name is so straightforward, you can understand it easily.
- If you want to save the selenium test project, you can click the Save project button on the top right corner of the selenium IDE window, then it will popup a dialog, you can input the file name ( TestSeleniumIDE.side ) and select a folder to save the selenium IDE test project.
- You can click the Open project button on the selenium IDE top right corner to open an existing selenium IDE project.
- You can click the Create new project button on the selenium IDE top right corner to create a new selenium IDE project.
- You can click the Add new test button on the selenium IDE window left side Tests panel’s top right corner to add a new test to the current project.