All Products
Search
Document Center

Performance Testing:Use a conditional jump instruction

Last Updated:Mar 11, 2026

A conditional jump instruction routes the execution path of a business session based on API response parameters. Use conditional jump instructions to build dynamic stress testing scenarios where subsequent steps depend on earlier API results, such as verifying an account balance before proceeding to checkout.

How conditional jump instructions work

A conditional jump instruction sits between APIs in a business session. During a stress test, PTS evaluates the conditions you define and decides which API to execute next.

Actions

Each conditional jump instruction supports a default action and one or more condition-based actions. Three actions are available:

ActionBehavior
JumpExecute a specified API in the business session instead of the next one in sequence. You must specify the target API.
ContinueProceed to the next API in sequence. If no subsequent API exists, the session ends.
EndStop execution of the current business session immediately.

Condition logic

ScopeLogicBehavior
Multiple conditions within one instructionANDPTS evaluates conditions in order. All conditions must be met for the associated action to trigger.
Multiple conditional jump instructions in the same sessionORIf multiple conditional jump instructions are configured in the same session, the action of the first instruction whose conditions are met is run.
No conditions metDefault actionIf no conditions are met, the Default Action determines the next step.

Example: E-commerce checkout flow

A typical e-commerce test scenario has four steps:

  1. Log on to the system.

  2. Top up the account balance.

  3. Add a product to the shopping cart.

  4. Complete the payment.

At the shopping cart step, the test must verify that the account balance was topped up before proceeding to payment. Place a conditional jump instruction after the "add product to shopping cart" API:

  • If the balance is topped up: Continue to the payment step.

  • If the balance is not topped up: Jump back to the "top up account balance" API.

This ensures the test flow mirrors real user behavior, where checkout only succeeds after a successful top-up.

Prerequisites

Before you begin, make sure that you have:

  • A PTS stress testing scenario with configured APIs. For details, see HTTP APIs

  • Response parameters configured for the API whose output the conditional jump instruction evaluates. For details, see API response parameters

Add a conditional jump instruction to a business session

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

  2. Add the APIs that make up the test flow. In the e-commerce example, add APIs for logging on, topping up, adding to cart, and completing payment.

  3. Configure response parameters for any API whose output the conditional jump instruction will evaluate. In the e-commerce example, configure response parameters for the "top up account balance" API so that downstream conditions can check whether the top-up succeeded.

    Response parameter configuration example

  4. In the Business Session section, click the Add Instruction drop-down list and select Conditional Jump.

  5. Expand Conditional Jump and configure the following settings:

    Conditional jump configuration example

    SettingDescription
    Default ActionThe action to take when no condition is met. Select Jump, Continue, or End.
    Select SessionThe API whose response parameters the condition evaluates.
    ActionThe action to take when all conditions in this group are met. If set to Jump, specify the target API.
    Add ConditionAdd a condition to the current group. Multiple conditions within one group follow AND logic.
  6. Place the configured Conditional Jump instruction after the appropriate API in the business session. In the e-commerce example, place it after the "add product to shopping cart" API.

Usage notes

  • Place a conditional jump instruction directly after the API whose outcome it evaluates. A misplaced instruction may produce unexpected routing.

  • When multiple conditions exist within one conditional jump instruction, all must be true (AND logic) for the associated action to run.

  • When multiple conditional jump instructions exist in the same session, the logical relationship between them is OR.

  • If no conditions are met across all conditional jump instructions, the Default Action determines the next step.

Related topics

  • HTTP APIs -- Add and configure APIs in a business session.

  • API response parameters -- Configure the response parameters that conditional jump instructions evaluate.