Record and play sample script in Selenium IDE
DAY 1
Creating First Selenium IDE Script
The entire script creation process can be classified into 3 chunks:Step #1: Recording – Selenium IDE aids the user to record user interactions with the browser and thus the recorded actions as a whole are termed as Selenium IDE script.
Step #2: Playing back – In this section, we execute the recorded script so as to verify and monitor its stability and success rate.
Step #3: Saving – Once we have recorded a stable script, we may want to save it for future runs and regressions.
Recording sample script in Selenium IDE
- Open new tab in Mozilla Firefox browser.
- Open selenium IDE.
- Click on "Record" button. (Please note here. It will start recording all navigation and action once you click on "Record" button.
- Now enter URL "https://www.google.co.in/" in your browser. (Selenium IDE will record that action. Make sure your recording is working fine.)
- Click on "Images" link displayed in main menu.
- Click on "Maps" link displayed in main menu.
- Click on "Play" link displayed in main menu.
- Stop Selenium IDE recording by clicking on "Stop Record" button. Your recording is completed now.
- My script will looks like bellow in selenium IDE.
| New Test | ||
| Command | Target | Value |
| open | https://www.google.co.in/ | |
| clickAndWait | css=#gb_2 > span.gbts | |
| assertTitle | Google Images | |
| clickAndWait | css=#gb_8 > span.gbts | |
| assertTitle | Google Maps | |
| clickAndWait | css=#gb_78 > span.gbts | |
| assertTitle | Google Play | |
No comments:
Post a Comment