Collections:
Use Variable in Selenium IDE for Chrome
How to Use Variables in Selenium IDE for Chrome?
✍: FYIcenter.com
When using variables in test steps in Selenium IDE for Chrome,
you need to remember the following:
1. Use "store *" commands to assign values to variables. For example, "store | Hello world! | message" assigns "Hello world!" as a text value to a variable named as "message".
2. Retrieve value from variable using the ${variable} expression. For example, "echo | ${message}" prints the text value from variable named as "message" in the log.
3. Don't use arithmetic expressions as values. Selenium IDE does not evaluate arithmetic expressions. For example, "store | 1+2+3+4+5 | sum" assigns the string "1+2+3+4+5" to "sum", not the value 15.
4. Use "execute script | return expression; | variable" to evaluate any expression and store the result to a variable. For example, "execute script | return 1+2+3+4+5 | sum" assigns 15 to "sum".
Here is a sample test called "Variable" on how to use variables:
1 store | Hello world! | message 2 echo | ${message} 3 store | 1+2+3+4+5 | sum 4 echo | ${sum} 5 execute script | return 1+2+3+4+5; | sum 6 echo | ${sum}
Here is the log output when you execute the above test.
1. store on Hello world! with value message OK echo: Hello world! 3. store on 1+2+3+4+5 with value sum OK echo: 1+2+3+4+5 5. executeScript on return 1+2+3+4+5; with value sum OK echo: 15 'Variable' completed successfully
⇒ Use "if ..." Command in Selenium IDE for Chrome
⇐ Test Step Commands in Selenium IDE for Chrome
2019-09-04, 6799🔥, 0💬
Popular Posts:
How to call JMeter command in a Windows batch file? I want to create a single batch job to run JMete...
How to expand IPv6 addresses? In order to help your programming or testing tasks, FYIcenter.com has ...
How to generate email addresses? To help you to obtain some email addresses for testing purpose, FYI...
How to convert hexadecimal encoded data back to binary data (or Hex to Binary Decoding)? Hex to Bina...
How to update hidden input value field value with WebDriver in Python? Normally, a hidden input valu...