Updated on 2024-10-11 GMT+08:00

Adding Logic Control to an API Script

Logic control is used to orchestrate test scenarios, including sleep, group, if condition, and loop.

Sleep

Sleep allows you to wait for a period of time after performing a test step.

To set Sleep, perform the following steps:

  1. Go to the Scripting tab page and click Sleep.
  2. Enter an integer from 1 to 60.

Group

  1. Go to the Scripting tab page and click Group.
  2. Enter the group name and drag related test steps to the group.

    • The URL Request, If Condition, Sleep, and Loop test steps can be grouped.
    • You can drag and orchestrate the sequence of groups in test cases.
    • You can drag and orchestrate the sequence of test steps in a group.
    • You can disable or delete all groups.

If Condition

If you need to determine the subsequent test steps based on the results of the previous test steps, you can use If Condition.

To set an if condition, perform the following steps:

  1. Go to the Scripting tab page and click If Condition.
  2. Enter the parameter, and add subsequent test steps to the branch.

    URL Request, If Condition, Sleep, and Loop can be added to the branch of the If Condition.

The if condition supports referencing local variables and passing parameters. For details about how to use comparison operators, see Comparison Operator Description.

Loop

  1. Go to the Scripting tab page and click Loop.
  2. Set the loop count.

    You can add URL requests, if conditions, groups, wait time, and test keywords to a loop.