Skip to main content

Use a previous teststep's data

Definition

This document describes how MTA handles data from one teststep to another.

Scenario

In MTA it is possible to use the output of one teststep, to pass data to another teststep.

Let's assume there is a generic teststep "A" and another teststep "B". B uses the data from A. A returns either a primitive or an object. Primitive values are either a String, Integer, Long, Decimal, Datetime or Boolean. There are a couple scenarios how B can use A's data:

ScenarioTeststep A is aReturns aTeststep B is aUses data to
1Microflow teststepPrimitiveMicroflow teststepFill primitive input parameter
2Microflow teststepPrimitiveCreate, Change or Retrieve Object teststepFill attribute value
3Microflow teststepEnumerationMicroflow teststepFill enumeration input parameter
4Microflow teststepEnumerationCreate, Change or Retrieve Object teststepFill attribute value
5Microflow teststepObjectMicroflow teststepFill object input parameter
6Microflow teststepObjectChange, Delete or Retrieve Object teststepPerform Change, Delete or Retrieve on
7Microflow teststepObjectCreate, Change or Retrieve Object teststepFill association
8Create, Change or Retrieve Object teststepObjectChange, Delete or Retrieve Object teststepPerform Change, Delete or Retrieve on
9Create, Change or Retrieve Object teststepObjectCreate, Change or Retrieve Object teststepFill association
10Microflow teststepObjectCreate, Change or Retrieve Object teststepFill attribute value from within object
11Microflow teststepObjectMicroflow teststepFill primitive/enum input parameter from within object
12Create, Change or Retrieve Object teststepObjectCreate, Change or Retrieve Object teststepFill attribute value from within object from within object
13Create, Change or Retrieve Object teststepObjectMicroflow teststepFill primitive/enum input parameter

Usage

Using Primitives

For Scenarios 1 and 2, the data is copied to MTA whenever executing the test. This means that it is possible to have teststep "A" in one Test Case, and "B" in the next Test Case. Also, for Scenarios 10 - 13, the data is first copied and then used to assign (fill) the value.

note

Note that because the data is first copied to MTA, the Domain Model Access on attributes is not checked when using the values from those attributes in another Test Case!

Furthermore, because primitives are the same for all Mendix Apps, it is possible to use different Applications for the Test Cases: have one Test Case test App "ABC" and have the other Test Case test "XYZ".

Implicit converts of datatypes

Below tables illustrate what datatypes are interchangeable and (implicitly) converted when executing the Test Case.

Note that a String value that is converted into other another datatype could lead to an error on the Teststep upon execution.

To set value for attribute that's a…Use attribute that's a…Or microflow return value that's a…
AutoNumber (only for Retrieve teststep)AutoNumber/Integer/Long/String (converted)IntegerLong/String (converted)
BooleanBooleanBoolean
DateTimeDateTimeDateTime
DecimalAutoNumber/Decimal/Integer/Long/String (converted)Decimal/Float/IntegerLong/String (converted)
HashStringHashString/StringString
IntegerAutoNumber/Integer/Long/String (converted)IntegerLong/String (converted)
LongAutoNumber/Integer/Long/String (converted)IntegerLong/String (converted)
StringAutoNumber/Integer/Long/StringIntegerLong/String
To set value for microflow parameter that's a…Use attribute that's a…Or microflow return value that's a…
BooleanBooleanBoolean
DateTimeDateTimeDateTime
DecimalAutoNumber/Decimal/Integer/Long/String (converted)Decimal/Float/IntegerLong/String (converted)
IntegerLongAutoNumber/Integer/Long/String (converted)IntegerLong/String (converted)
StringAutoNumber/Integer/Long/StringIntegerLong/String

Using Enumerations

For Scenarios 3 and 4, the data is also copied to MTA whenever executing the test. However Enumerations are App-specific. This means that it is possible to have teststep "A" in one Test Case, and "B" in the next Test Case, but both Test Cases need to test the same Application.

Using Objects

For Scenarios 5 - 9 the data is not copied to MTA whenever executing the test. Instead, MTA uses the Object's ID to refer to the Object in-memory. Consequentually whenever retrieving data, regardless of which Teststep is being used to retrieve from, always the latest state of that object will be retrieved.

caution

Beware that when changing an Object after retrieving it, if you retrieve it again from that same teststep, it will still be changed!

Feedback?

Missing anything? Let us know!

Last updated 23 february 2023