Assertions with variables

When you define a test using the mabl trainer, you can include assertions that describe logic that mabl should use to confirm that your application is in a correct state at a specified step in a test run. Not only can you compare elements on the page to text or values, but you can also compare against variables and various attributes. If you have questions regarding how to add and use variables, you can find the information in the "Using variables" document.

📘

Important Assertions Information

Currently, you can only add assertions while you are defining a new test using the mabl trainer. See "Defining a test with the mabl trainer" for general information on this.

Currently, mabl supports the following assertion types against a variable where the inner text or other property of the selected element:

  • Equals
  • Does not equal
  • Contains
  • 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

Step-by-step instructions for adding an assertion with a variable

  1. In the mabl trainer window, click "Add assertion."
  2. Click on the element that you want to include in your assertion.
Click on the element in the page to assert against the variable.Click on the element in the page to assert against the variable.

Click on the element in the page to assert against the variable.

  1. Choose your assertion type from the drop-down.
  2. Choose your desired element attribute/property, including custom attributes.
  3. Select the "Variable" radio button under the "Compare to" section.
  4. Select the variable you'd like to compare to.
  5. Click "OK"
  6. Continue with your training session, if applicable.
A sample of how to alter and apply an assertion.A sample of how to alter and apply an assertion.

A sample of how to alter and apply an assertion.


Did this page help you?