All Products
Search
Document Center

Performance Testing:Pass parameters between APIs in a business session

Last Updated:Mar 11, 2026

When a multi-API business session runs during a stress test, subsequent APIs often depend on values returned by earlier ones -- for example, passing a product ID from a "browse" API to "add to cart" and "checkout" APIs. A parameter command instruction redefines data export parameters and response parameters of the previous API, storing the result as a reusable parameter for all downstream APIs in the same session.

How it works

A parameter command instruction sits between two API nodes in a business session. It takes a response parameter or data export parameter from the preceding API, applies an expression to redefine the value, and stores the result as a new parameter. All subsequent APIs in the session can reference this parameter by name.

Key behaviors:

  • A business session supports multiple parameter command instructions.

  • Parameter command instructions operate on response parameters and data export parameters only. They cannot process global file parameters or global custom parameters.

Add a parameter command instruction

This section walks through a concrete example: extracting the first five characters of a product ID returned by one API and passing the extracted value to subsequent APIs.

Example scenario

The business session contains three APIs:

OrderAPIRole
1Browse a productReturns a product ID in its response
2Add the product to the shopping cartNeeds the product ID from API 1
3Complete the paymentNeeds the product ID from API 1

Prerequisites

Before you begin, make sure you have:

Procedure

  1. Log on to the PTS console, choose Performance Test > Create Scenario, and then click PTS.

  2. Create and configure the three APIs: browse a product, add the product to the shopping cart, and complete the payment. For details, see HTTP APIs.

  3. Configure response parameters for the browse a product API so that the product ID is available for extraction. For details, see Operation response parameters.

    Response parameters configuration for the browse-a-product API

  4. In the Business Session section, expand the Add Instruction drop-down list and select Parameter Command.

  5. Expand Parameter Command and configure the following fields:

    • Parameter Name: Enter a name for the new parameter, for example, ShortProductID.

    • Parameter Logic: Enter the expression that extracts the value.

    In this example, enter the following expression to extract the first five characters of the product ID:

       _${sys.substring("${ProductID}", 0, 4)}_
    ComponentDescription
    ${ProductID}References the response parameter defined in the business session
    sys.substring(..., 0, 4)Extracts characters at index positions 0 through 4 (five characters total, zero-indexed)
    _..._Wraps the expression for evaluation

    Parameter Command configuration showing the expression

Usage notes

  • To pass multiple values between APIs, add multiple parameter command instructions, each defining a separate parameter.

Related topics