Skip to content

Variables

Márcio Mendes edited this page Jul 15, 2019 · 2 revisions

If you need to use a value between scenarios, for example, register one product and validate if this product will appear correctly in the search page by a single dynamic ID. You should be store this value in a variable. The following description will teach you how to do this.

Store a value in a variable

  • sentence: When user stores the value '654789' in variable 'product_id'

Read a value from variable

If you need to use a value from a variable you should use the pattern ${vars.varName} in any of the other sentences that interact with web elements using text (fill, select, etc).

Example:

  • sentence: When user prints the message 'The product id is **${vars.product_id}**' to console
  • how it works: The system will replace the value
  • results: The message "The product id is **654789**" appears in the console.
Clone this wiki locally