Skip to main content
Version: 2.8.0

Retrieve Object

Definition

With this Teststep type, objects can be retrieved from database or memory and used in subsequent Teststeps. Values entered for attributes and associations will be converted into an XPATH expression and subsequently filter the list of objects retrieved. Also objects that are output from previous teststeps can be filtered.

Domain model Access

Domain model access rights apply if the Test Case that the teststep is in, has Apply Security enabled.

Upon executing a Retrieve teststep, MTA will evaluate the Execution user's Read rights on the Domain Model through the configured User Roles.

Only objects that pass this evaluation will be included in the results in the Test Run.

To circumvent domain model access rights it is not possible to use a Microflow teststep; above evaluations will also be performed for the object(s) returned by the microflow.

Retrieve from database

  • Navigate to the Test Suite and select the Test Case that you want to create a Teststep in.
  • Click " Add" and Click " Retrieve teststep" to add a Retrieve Object Teststep.
  • Select an entity. You can search by name.
  • Select either "All objects" or "Only first object" in the Retrieve options. Note that when there are more than 1000 results, the Teststep will result in a Construction Error, even if only retrieving the first object. In that case you need to filter using attributes and associations.
  • Select "Retrieve from database" in the Retrieve options.
  • Set filter values.
  • Click on the "Save" button.

Retrieve by association

  • Navigate to the Test Suite and select the Test Case that you want to create a Teststep in.
  • Click " Add" and Click " Retrieve teststep" to add a Retrieve Object Teststep.
  • Select an entity. You can search by name.
  • Select either "All objects" or "Only first object" in the Retrieve options. Note that when there are more than 1000 results, the Teststep will result in a Construction Error, even if only retrieving the first object. In that case you need to filter using attributes and associations.
  • Select "Retrieve by association" in the Retrieve options.
  • Set filter values.
  • Click on the "Save" button.

Note that when retrieving by association, data needs to exist either in database, or have been created in the same Test Case. Data created in a previous Test Case that is not saved to the database will be lost.

Retrieve from former Teststep

There are two options to Retrieve from former Teststep. The first option is quicker:

Option 1:

  • Navigate to the Test Suite and select the Test Case that you want to create a Teststep in.
  • Click on the button on the Teststep that returns the object that you want to retrieve, and choose " Retrieve output".

Option 2:

  1. Navigate to the Test Suite and select the Test Case that you want to create a Teststep in.
  2. Click " Add" and Click " Retrieve teststep" to add a Retrieve Object Teststep.
  3. Select an entity. You can search by name.
  4. Select the previous Teststep that returns the object that needs to be retrieved. This could be a Create, Change or Retrieve Teststep but also a Microflow Teststep that returns an object.
  5. Select either "All objects" or "Only first object" in the Retrieve options. Note that when there are more than 1000 results, the Teststep will result in a Construction Error, even if only retrieving the first object.
  6. Select "Retrieve using output from former test step" in the Retrieve options.
  7. Set filter values.
  8. Click on the "Save" button.

Note that when retrieving from a former Teststep in a previous Test Case, data needs to be saved to the database in that Test Case. Data created in a previous Test Case that is not saved to the database will be lost.

Set filter values

info

Binary attributes are not supported by MTA.

Include or exclude an Attribute filter

  • Toggle the button next to the attribute to include or exclude it.

Manually set an Attribute filter

  • Click on the right of the attribute, which indicates that a filter operation and value(s) will be entered manually.
  • Choose an Operator (see below for the complete list).
  • Enter or select value(s) to be used as a filter on the attribute.

Note: For datetime values you can either specify a date, or calculate the date with an offset from the current datetime.

The following Operators are supported for the Mendix data types:

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

Use the value from a former Teststep to set the Attribute filter

  • Click on the right of the attribute, indicating a former Teststep should be used to set the value.
  • Select the Teststep and (if the Teststep returns an Object) find the Attribute that should provide the value.

Note: you cannot choose to have a former Teststep set the value if you want to specify a Range of values.

Assign associations

  • Click " Add" for each association that you want to set.
  • Use the " Set empty" button to clear the association.

Note that multiple values can only be set for both way reference set (many to many) associations.

Generate assignments from database

You can choose to fill all the attributes and associations using existing values in the database, by clicking " Fill teststep with data" and then "Fill with stored data". This will fill the attributes with values based on a random Object retrieved from the database, and fill associations where the that Object is the owner.

note

Because of performance reasons, the amount of associations retrieved is limited to 3.