Data Propagation

Overview

Data Propagation is the ability to capture data from one test step and automatically pass it to subsequent steps in your workflow. This enables realistic end-to-end testing where each step uses output from previous steps, creating complex scenarios that mirror actual user workflows.


Why Data Propagation Matters

Tests flow like real users - output from one action becomes input to the next.


How Data Propagation Works

Basic Data Flow

Step 1: API Create User
  └── Response: {user_id: "123", email: "[email protected]"}

Step 2: API Login
  └── Input: email from Step 1
  └── Response: {token: "abc123def456"}

Step 3: Web Login
  └── Input: email and password
  └── Use token from Step 2 in header

Step 4: Web Verify Profile
  └── Use token from Step 2
  └── Verify user_id from Step 1 in profile

Data Variable Syntax

circle-info

Reference previous step outputs using variable syntax:

${step_name.output_field} or ${step_number.output_field}

Examples:

  • ${Step1.user_id}

  • ${CreateUser.email}

  • ${2.response.token}


Capturing Output Data

Types of Data to Capture

API Responses

  • JSON fields: $.user.id, $.response.status

  • Response headers: Authorization, Set-Cookie

  • Status codes

  • Response body

Web/Mobile Outputs

  • Text values from elements

  • Attribute values

  • Page titles/URLs

  • Form field values

Database Queries

  • Query results

  • Column values

  • Record IDs


Extracting Data from Steps

Method 1: Automatic Extraction

Test scripts may automatically output data:

Method 2: Manual Extraction

Specify which data to capture:

  1. Open step configuration

  2. Click "Extract Output" or "Capture Data"

  3. Define extraction rules:

    • Field name

    • Source (response, header, etc.)

    • Path to value (JSON path, XPath, etc.)

  4. Save configuration

Method 3: Data Hub

Store data in centralized location:


Using Captured Data

Example 1: User Creation and Login

Example 2: Payment Processing


Data Mapping

Simple Mapping

Direct field-to-field mapping:

Complex Mapping

Transform data during mapping:

Conditional Mapping

Use data conditionally:


Data Transformation

Available Transformations

Function
Purpose
Example

substring()

Extract part of string

${Step1.email.substring(0, 5)}

toUpperCase()

Convert to uppercase

${Step1.name.toUpperCase()}

toLowerCase()

Convert to lowercase

${Step1.name.toLowerCase()}

replace()

Replace text

${Step1.url.replace('http', 'https')}

split()

Split string

${Step1.data.split(',')[0]}

trim()

Remove whitespace

${Step1.text.trim()}

parseInt()

Convert to integer

${parseInt(Step1.count)}

Date functions

Date manipulation

${now()}, ${formatDate()}

Example Transformations


Accessing Nested Data

JSON Path Navigation

Access nested values using dot notation:

Array Access

Access array elements:


Real-World Workflow Examples

Example 1: E-Commerce End-to-End

Example 2: API Data Pipeline


Best Practices

✅ Do

  • Capture all relevant output data

  • Use descriptive variable names

  • Document data flow in comments

  • Test data propagation with sample data

  • Handle missing/null data gracefully

  • Validate captured data format

  • Use data transformation when needed

  • Monitor data for sensitive information

❌ Don't

  • Propagate sensitive data (passwords, keys) unnecessarily

  • Assume data format (verify structure first)

  • Create overly complex data transformations

  • Forget to handle null/missing data

  • Store unnecessary data

  • Hardcode values when propagation available

  • Propagate across unrelated workflows

  • Leave sensitive data in logs


Troubleshooting

Issue: Variable not recognized

Symptoms:

  • Variable shows as literal text: ${Step1.email}

  • Step fails with "variable not found"

Solutions:

  1. Verify step name or number is correct

  2. Check field name spelling

  3. Confirm output was actually captured

  4. Review step execution to verify output

Issue: Data format incorrect

Symptoms:

  • Data arrives in wrong format

  • Type mismatch (string vs number)

  • Transformation not working

Solutions:

  1. Review data structure from source step

  2. Add type conversion: ${parseInt(Step1.value)}

  3. Test transformation logic

  4. Use correct accessor path

Issue: Null or empty values

Symptoms:

  • Variable is null or empty

  • Step fails with null reference error

Solutions:

  1. Add null checking: ${Step1.value || 'default'}

  2. Verify previous step executed successfully

  3. Check conditional logic for step execution

  4. Review if step is being skipped


Integration with Other Features

  • Session Persistence: Data persists across steps

  • Action Types: Retry and data extraction work together

  • Notifications: Include propagated data in alerts

  • Reports: Show data flow and transformations

  • Data Hub: Store and retrieve propagated data


Last updated