Google+

Using 'pause' command in Selenium IDE for halting the execution for a specified time

pause command is one of the Selenese commands in Selenium IDE and is used to halt the execution for a specified time.

Prerequisites:

In order to implement pause command in Selenium IDE, we have to first install 'Selenium IDE' firefox add-on in firefox browser. If you don't have Selenium IDE add-on installed in your firefox browser, follow the below posts first:


And also refer to the below post for opening the Application URL in the Firefox Browser using Selenium IDE:


Implementing 'pause' selenese command in Selenium IDE for halting the execution for a specified amount of time:

Note: In this practical example, we will first open "http://www.omayo.blogspot.com" using "open" command, then next will halt the execution for 20 seconds using the "pause" command and finally click on the "Selenium143" link on the page using "click" command. Just focus on the time the Selenium IDE test has halted after opening the application URL and till the "Selenium143" link on the application page is clicked.

Lets follow the below steps for implementing the pause selenese command for halting the execution for a specified amount of time:

1. Open Firefox browser and select 'Tools' Menu > 'Selenium IDE' option as shown below:



2. A 'Selenium IDE' window will be displayed as shown below:



3. Select the first row in the 'Table' pane as shown below:



4. While the first row is selected, type the letter 'o' into the 'Command' box field and observe that the 'open' command will be provided by the Selenium IDE as an auto suggestion as shown below:



5. Select 'open' from the auto suggestion and observe that 'open' text got entered into the 'Command' field as shown below:



6. Now enter any application URL say 'http://www.omayo.blogspot.com' into the 'Target' box field as shown below:



7. Now, select the second row in the 'Table' pane as shown below:



10. Enter the command text 'pause' into the 'Command' field as shown below:



11. If you want to wait for 20 seconds (i.e. 20,000 milliseconds), then enter '20000' into the 'Target' field as shown below:



12. Now, select the third row in the 'Table' pane as shown below:



13.  Enter the command text 'click' into the 'Command' field as shown below:



14. Now click on 'Select' button on 'Selenium IDE' and select the hyperlink 'Selenium143' on the application URL page as shown below:



15. Locator Strategy for the 'Selenium143' hyperlink will get auto generated in th Target field of Selenium IDE as shown below:



16. Now lets run the Selenium IDE test. Click on 'Play current test case' option as shown below:



17. Observe that the application URL provided in the Selenium IDE will be opened as part of first step, execution of Selenium IDE test will get halted for 20 seconds as part of second step and finally 'Selenium143' link on the application page will be clicked as part of third step. Also observe that the executed test case in Selenium IDE will be displayed as passed as shown below:






Conclusion

pause command in Selenium IDE is one of the selenese commands. The purpose of this command is to halt the execution of Selenium IDE for the specified amount of time. 

No comments: