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.
It is important to understand that variables have a hierarchy in which they can be overridden.
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 override 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 override 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 override global variables and built-in variables.
Script-generated variables
Variables saved by a command in the script are the most dynamic type and override variables of all other origins. They can be generated in the script in the following ways:
- Generating a randomized string of 30 characters or a randomized string by template or Regex
- 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 API responses
- 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
- Saving any string (
save value "string" as "variable"
) - Saving the result of an equation (
save expression "1 + 1" as "answer"
)
Parameters
from the string with parameters
or from the string with escaped parameters
. Variables inside a string with parameters are indicated by using a $
and curly brackets {}
around the variable key as follows: ${variable}
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"
In the case of identical syntax, a defined rule always has higher priority than general syntax.
You can combine static text with variables, for example:
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 a string with parameters "Welcome, ${firstName} ${lastName}!"