This guide provides an overview of how to create a variable assertion. Some use cases for variable assertions include:
- Extracting an element property into a variable on one page, extracting another element property from another page, and asserting that the two variables equal each other
- Asserting on the expected value coming from a DataTable
Using variables as expected values
If you are looking for information on how to assert element properties or attribute values against the values that can come from a variable, see the documentation on element assertions.
- In the mabl Trainer window, click on the check mark icon to add an assertion.
- Select Variable in the Trainer window.
- Configure the assertion in the variable assertion menu.
- Click OK.
The variable assertion menu is where you define the criteria of your assertion. These are the settings:
- Variable: When you choose a variable from the dropdown, its expected value is displayed.
- Assertion type: Choose an assertion type. Supported assertion types for variables include:
- Does not equal
- Does not contain
- Starts with
- Does not start with
- Ends with
- Does not end with
- Greater than
- Less than
- Greater than or equals
- Less than or equals
Updated 6 months ago