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
10 (N/A)Microflow teststepObjectCreate, Change or Retrieve Object teststepFill attribute value from within object
11 (N/A)Microflow teststepObjectMicroflow teststepFill primitive/enum input parameter from within object
12 (N/A)Create, Change or Retrieve Object teststepObjectCreate, Change or Retrieve Object teststepFill attribute value from within object from within object
13 (N/A)Create, 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. 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".

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!

Using values within Objects

Lastly scenario's 10 - 13 are currently not yet supported. It is necessary to write a microflow instead to retrieve the primitive value from the object.

Feedback?

Missing anything? Let us know!

Last updated 23 february 2023