Generative AI-Based Testing Certification
Variables
In testRigor, variables allow users to parameterize values, work with dynamically generated information, or pull test data from a global bank of variables in testRigor. To use a variable in a command, add stored value or saved value before the variable in double quotation marks.
save value "James" as "name"
enter stored value "name" into "First Name"
Variable Hierarchy
Variables follow a hierarchy that determines which value is used when multiple variables share the same name:
Script-generated > Data Set > Global > Built-in
If you have two variables named username:
Global variable: username = “John”
Script-generated variable: username = “Eric”
Since script-generated variables have higher precedence, username will resolve to “Eric”.
Built-in variables
testRigor has built-in variables that users can access for things like the current date and time, the base url, and the username and password (given the username and password have been saved in settings), among others. Built-in variables do not overwrite any other variable.
Global variables
Global variables must be uploaded into the test data storage bank in testRigor by the user. These can be in the form of text, hidden strings, files, and multiline strings. In order of priority, global variables overwrite built-in variables. Read more about global variables here.
Data Sets
Data sets have two main uses in testRigor. First, it allows users to test the same scenarios multiple times simultaneously using different parameters or test data. Some users do not need to test simultaneously, but rather swap out entire sets of global variables in order to test scenarios on environments with slight differences. This is easy to do now that testRigor allows users to link/unlink multiple or all test cases to a data set.
Data sets can be created manually or by uploading a csv file as explained in this document and can also be in the same forms as global variables. In terms of hierarchy, data sets overwrite global variables and built-in variables.
Script-generated variables
Variables saved by a command in the script are the most dynamic type and overwrite variables of all other origins. They can be generated in the script in the following ways.
Some of the most common ways to create script-generated variables include:
- Generating a randomized string of 30 characters or a randomized string by template or Regex
- Saving API responses
- Grabbing values on the screen; this can be done by targeting a value that matches a Regex or template (
grab value of "regex"), targeting a field with text (grab value from "field"), or both (grab value of "regex" from "field") - Saving any string (
save value "string" as "variable") - Saving the result of an equation (
save expression "1 + 1" as "answer")
Other commands can also generate or save variables, including:
- Extracting values by Regex or template
- Saving SMS messages and temporary numbers
- Saving downloaded files or text from downloaded files
- Saving cookies and items from local storage
- Saving an audio recording
- Saving database responses (these are saved automatically with the query)
- Saving QR code secrets
Parameters
from the string with parameters or from the string with escaped parameters. ${variable} allows you to insert a saved variable into a larger string.check that page contains the string with parameters "Welcome, ${firstName} ${lastName}!"enter from the string with parameters "${homePrefix}/my/path" into "urlPath"
generate from template by string with escaped parameters "${nowDateTimeIso}-**********", then enter into "Data" and save as "generatedData"
enter from the string with parameters text starting from next line and ending with [END]
${file_var_one}
<FILE_URL>
[END] into file input "myFileInput"
You can combine static text with variables, for example:
Fill in the form:
generate unique name, then enter into "First Name" and save as "firstName"
generate unique name, then enter into "Last Name" and save as "lastName"
check that page contains the string with parameters "Welcome, ${firstName} ${lastName}!"
Grabbing values from the UI using AI
AI can be used to extract values from the UI based on a description you provide for the target element.
Example:
grab value by description "10-digit phone number" using AI and save it as "phoneNumber"
Here, 10-digit phone number is the prompt given to AI. AI locates the element that best matches the description and retrieves its value.
If you want to limit the search to a specific section of the UI rather than scanning the entire page, you can include the element or area name in the command.
Example:
grab value by description "10-digit phone number" from "Contact form" using AI and save it as "phoneNumber"
This is useful when the same value type appears multiple times on the page. In this case, AI will only grab the 10-digit phone number that is inside the Contact form.
Reusable Rules
When a reusable rule has the same syntax as a built-in testRigor command, the rule takes priority.
For example, generate from template is recognized by testRigor. If we create a reusable rule also called generate from template , testRigor will use our rule instead.
Reusable-rule priority: which command/rule gets executed when syntax overlaps.
We’ll cover reusable rules in more detail later, so for now, just keep in mind that they take priority over built-in commands.



