Skip to main content
Version: 2.8.0

Assert on Attribute

Definition

An Assert on Attribute formulates an expected result of an attribute in an Object action Teststep upon execution. It is possible to either define the result to have a single value, or a range that the value should be in. A Teststep can have multiple Asserts on Attribute.

An Assert on Attribute can be added for a value of an attribute in an Object action Teststep.

When a Teststep uses Data Variation to manipulate Teststep input, the Assert can be applied as a Data Variation Item for each defined variation.

Properties

NameDescription
Compare typeThe type of comparison to be made.
- The 'Equals' / 'Not equals' type means that the attribute value should exactly match (or not match, respectively) a single given value.
- The 'Range' / 'Not range' type means that the attribute value should be within (or outside, respectively) the given boundaries. A 'Range' type is only applicable for numeric or date attributes.
- The 'Greater than' / 'Greater than or equal to' means that the attribute value should be higher than (or include, respectively) the given value.
- The 'Less than' / 'Less than or equal to' means that the attribute value should be lower than (or include, respectively) the given value.
ValueThe expected value of the attribute upon executing the test when the selected compare type is 'Equals'. If the asserted value is empty, the result must be empty in order for the assert to pass.
Min valueThe expected lower boundary of the attribute value if the selected compare type is 'Range'.
Max valueThe expected higher boundary of the attribute value if the selected compare type is 'Range'.
Trim string valuesUsed to be able trim string values for leading and trailing space characters before evaluating the result (only applicable for string attributes).

Business rules

The following Assert Compare types are supported for the Mendix data types:

StringIntegerDecimalBooleanDatetimeEnumeration
Equals
Does not equal
Contains
Does not Contain
Within Range
Outside of Range
Greater than
Greater than or Equal to
Less than
Less than or Equal to

Actions on an Assert on Attribute

Add an Assert on Attribute

There are multiple ways to add an Assert on Attribute:

  1. Navigate to the "Attributes" tab in the "Details of teststep" pane on the right in the Test Suite overview page. Click on next to the attribute to add the Assert;
  2. Click on the button on the Teststep where you want to add an assert, and click " Edit asserts" to open the page where asserts can be configured. Click on next to the attribute to add the Assert;
  3. Click on "Save and configure asserts" after configuring the Teststep. This will show the page where Asserts can be configured. Navigate to the "Attributes" tab, click on the " Assert" button to add the Assert.

Delete an Assert on Attribute

  • Click on the button on the Teststep where you want to delete an assert, and click " Edit asserts" to open the page where asserts can be configured;
  • Click on on the attribute to delete the Assert from.
  • Click on the button.

Feedback?

Missing anything? Let us know!

Last updated: 19 january 2023