Collections:
Use "while ..." Command in Selenium IDE for Chrome
How to Use "while ..." Command in Selenium IDE for Chrome?
✍: FYIcenter.com
When using "while ..." Commands in test steps in Selenium IDE for Chrome,
you need to remember the following:
1. Use "while ... end" to form a loop block of test steps.
2. Use JavaScript Boolean expression syntax to specify conditions to "while" commands.
3. ${variable} is allowed in condition expressions.
4. You can use "execute script" command in loop block to update the loop condition control variable in ${variable} format. But Selenium IDE variables are considered as text strings. You need to convert them to number, if needed.
Here is a sample test called "While" on how to use variables:
1 store | 0 | sum
2 store | 1 | count
3 while | ${count} <= 10
4 execute script | return Number(${sum}) + Number(${count}); | sum
5 execute script | return Number(${count})+1; | count
6 end
7 echo ${sum}
Here is the log output when you execute the above test.
1. store on 0 with value sum OK
2. store on 1 with value count OK
3. while on ${count} <= 10 with value 100 OK
4. executeScript on return Number(${sum}) + Number(${count}); with value sum OK
5. executeScript on return Number(${count})+1; with value count OK
6. end OK
echo: 55
⇒ Debug Tests in Selenium IDE for Chrome
⇐ Use "if ..." Command in Selenium IDE for Chrome
2019-06-28, ∼5268🔥, 0💬
Popular Posts:
How to convert hexadecimal encoded data back to binary data (or Hex to Binary Decoding)? Hex to Bina...
How to find out my browser's identification information? To help you to see your browser identificat...
How to see my IP address Host Name? To help you to see your IP Address Host Name, FYIcenter.com has ...
How to find out my browser request headers? To help you to see your browser request headers, FYIcent...
Where to find tutorials on Selenium test tools? I want to know how to use Selenium. Here is a large ...