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:
- Go to the Scripting tab page and click Sleep.
- Enter an integer from 1 to 60.
Group
- Go to the Scripting tab page and click Group.
- Enter the group name and drag related test steps to the group.
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:
- Go to the Scripting tab page and click If Condition.
- 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
- Go to the Scripting tab page and click Loop.
- Set the loop count.
You can add URL requests, if conditions, groups, wait time, and test keywords to a loop.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot