Variables

Access all your data in JS steps by using Javascript and GLOBALS. Change data with parameters and variables in check, type text and JS steps to create complex but reusable traces.

Use variables in your traces to copy a piece of text and use it later in the trace.


Random & Javascript

Typing ‘random’ in text results a randomized value when running the trace. Here the email (1) is randomized.

The typed word, or in this case email address, can be later access directly in Javascript. You can see the accessible variable name also under step’s parameters as the Default value (2).


Assigning globals in Javascript

Example of copying a value of one variable into another variable. This example is to copy a value to a shorter, easier to use variable.


Check using a variable’s value

Add a check to the text you would like to verify on the page. Here we check to verify the correct “To:” line in an email (1).

You can configure check to use variables. Here we have entered our previous define variable to check for text “To: #{randomEmail}” (2).


Typing a variable’s value

As an example, here’s a random date that we assign to variable “date”.

You can type variables to your website by using #{variableName} expression inside your text. In this example (1) we have typed “date #{date} from JS”.

The output text will then have the value of the variable typed on the website (2).


Use variables between JS steps

When your webapp sends an email containing a token that must be copied and pasted in a form, create a Javascript step and parse a token from the email message using JavaScript code and copy it to GLOBALS for later use:

Later in the trace, write (paste) the token from GLOBALS to a form field: