Adding a Do-While step
You can insert the Do-While logic in a test to make a set of steps run
in a loop only if a specific condition is met after the first iteration.
Before you begin
You must have completed the following tasks:
- Ensured that you are assigned a Team Space Owner, Project Owner, or Member with a Tester role to create or edit a test resource.
- Read and understood the information in Edit branch overview and Create or select an Edit branch.
- Ensured that your project contains a Web UI test.
- Opened the test in Test Editor. See Editing a Web UI test.
Procedure
-
Click the
button displayed on the Test
Editor page.
The Edit button appears only when no active edit branch is selected.
Alternatively, right-click the test in the test navigator panel and select Edit.
The Edit branch dialog is displayed.If the Edit branch dialog is not displayed, then go to step 3. - Select an existing edit branch or create a new edit branch.
- Drag and drop the Do While element under any test step as required from the Flow catalog in the Catalog tab.
-
Click the Do While step.
The step details pane is displayed.
-
Perform the following steps in the step details pane:
- Select a variable in the Value 1 list.
- In the Operator field, indicate the basis of comparison of
the two operands. Note that the two operands are strings.The available operators are as follows:
- Equals
- Greater Than
- Greater Than Equals
- Equals variable
- Less Than
- Less Than Equals
- Strict Equals
- Enter a value to be compared with the value of the selected variable in the
Value 2 list.
Alternatively, you can select the Code checkbox to enter the
Do-Whilestatement in the text box. - Select the Negate the operator checkbox to negate a condition
when you perform a comparison.
For example, if the result of any condition is true, the result returns false.
-
Click the Save icon
to save the modifications.