Assert on Attribute
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.
|Compare type||The 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.
|Value||The 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 value||The expected lower boundary of the attribute value if the selected compare type is 'Range'.|
|Max value||The expected higher boundary of the attribute value if the selected compare type is 'Range'.|
|Trim string values||Used to be able trim string values for leading and trailing space characters before evaluating the result (only applicable for string attributes).|
The following Assert Compare types are supported for the Mendix data types:
|Does not equal|
|Does not Contain|
|Outside of Range|
|Greater than or Equal to|
|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:
- 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;
- 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;
- 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.
Missing anything? Let us know!
Last updated: 19 january 2023