All Products
Search
Document Center

Performance Testing:Conditional jump instruction

Last Updated:Jun 20, 2026

You can use conditional jump instructions to control the execution path of requests in a business session based on an API's response parameters. This topic uses a typical e-commerce scenario to demonstrate this process.

Background information

You can add a conditional jump instruction after an API. It supports actions such as jump, continue, and end. Multiple conditions within a single instruction have a logical AND relationship and are matched sequentially during a stress test. Multiple conditional jump instructions have a logical OR relationship.

In a typical e-commerce scenario, the user workflow is: log on, top up, add to cart, and pay. You can set a conditional jump at the "add to cart" step to check if the user's account has been topped up. If it has, the process continues. Otherwise, the process jumps back to the top up API.

Procedure

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

  2. Add and configure the Logon, top up, add to cart, and pay APIs. For more information, see HTTP API.

  3. In the top up API, configure a response parameter. For more information, see API response parameter.

    Set the response parameter name to out1, select Body : JSON as the source, and enter (.*) as the parsing expression.

  4. In the Business Session area, click the drop-down arrow next to Add Instruction and select Conditional Jump.

  5. Expand Conditional Jump, and then configure the Default Action and jump conditions. In this example, use the following configuration.

    Set Default Action to Continue. Add a conditional branch: for Select Session, select top up. Set the condition where the response parameter out1 Equals 1. For Action, select Jump, and for Jump to, select top up.

    • Default Action: The action performed if no conditions are met. Options include Jump, Continue, and End.

      • Go To: Jumps to another API within the current business session.

      • Continue: Proceeds to the next node. If there is no next node, the execution ends.

      • End: Stops the current execution path.

    • Select Session: Select the API that provides the response parameter for the condition.

    • Action: The action performed if the condition is met. Options include Jump, Continue, and End. If you select Jump, you must also specify a target API.

    • Add Condition: Adds another condition to the instruction. All conditions within a single instruction use a logical AND.

  6. Move the Conditional Jump instruction after the add to cart API.