waitFor and Pause Both are synchronization commands.
Arguments:
You can use this command instead of the “AndWait” suffixes, “clickAndWait”, “selectAndWait”, “typeAndWait” etc. (which are only available in the JS API).
Selenium constantly keeps track of new pages loading, and sets a “newPageLoaded” flag when it first notices a page load. Running any other Selenium command after turns the flag to false. Hence, if you want to wait for a page to load, you must wait immediately after a Selenium command that caused a page-load.
Pause:
Arguments:
Difference
If pages loads before the time it will continue to next step.
Pause:—Will pause test until the specified time
If you want to pause test case in middle follow the below steps:
Let’s say there are 6 commands in your script and you want to pause your script at 3rd command.
Right click on command 3 and select Toggle/Break Point. Automatically you can see pause symbol in the test case pane. Your test will be paused at command 3. If you want to remove the pause repeat the same step. Pause symbol should be removed.
If you want to execute a script from middle follow below steps:
Let’s say there are 6 commands in your script and you want to start your script from 3rd command.
Right click on command 3 and select set/clear start point. Automatically you can see RUN Symbol in the test case pane. If you start running the script. Your test will be start running from command 3. If you want to remove the start point repeat the above step. RUN symbol should be removed.
Checkout Selenium Interview Questions
If you want to execute a single command in script from middle follow below steps:
Let’s say there are 6 commands in your script and you want to execute 3rd command.
Right click on command 3 and select Execute this command. Automatically that command will be executed. Or you can double click on that command. Command will be executed
Name | Dates | |
---|---|---|
Selenium Training | Sep 24 to Oct 09 | View Details |
Selenium Training | Sep 28 to Oct 13 | View Details |
Selenium Training | Oct 01 to Oct 16 | View Details |
Selenium Training | Oct 05 to Oct 20 | View Details |
Madhuri is a Senior Content Creator at MindMajix. She has written about a range of different topics on various technologies, which include, Splunk, Tensorflow, Selenium, and CEH. She spends most of her time researching on technology, and startups. Connect with her via LinkedIn and Twitter .