Run the below script in selenium IDE:
Command | Target | Value |
storing a search key as variable |
|
|
store | hello selenium | x |
store | 1 | y |
test script started from here |
|
|
while | (${y}<10) |
|
gotoif | storedVars['y']<5 | google |
storeEval | alert('Test execution stopped!!') |
|
label | google |
|
echo | ${x} |
|
echo | ${y} |
|
open | / | |
focus | //input[@id='gbqfq'] |
|
type | //input[@id='gbqfq'] | ${x} |
focus | //button[@id='gbqfb'] |
|
clickAndWait | //button[@id='gbqfb'] |
|
storeEval | storedVars['y'] = ${y}+1 |
|
endWhile |
|
|
test script ended from here |
|
|
storeEval | alert('Test executed successfully!!') |
|
* Base URL:
http://www.google.co.in/
In the above script we are using gotoif command to run the script directly from defined label “google” based on such condition when incremented value of y is less than 5.
Read more about LABEL COMMAND IN SELENIUM IDE USING FLOW CONTROL EXTENSION.
Read more about GOTOIF COMMAND IN SELENIUM IDE USING FLOW CONTROL EXTENSION.
0 Comments
What would you like to add in my list? I look forward to reading your comments below.