while
Denotes the beginning of a while/end while loop. Evaluates a conditional expression to determine whether execution is to continue with the action lines directly below it, or with the lines following the matching end while.
Name | Description | Type | Modifier |
---|---|---|---|
condition to run | Expression which, when evaluated to True, allows control to proceed to the succeeding action lines. When evaluated to False, control passes to the first action line following the associated end while. | String | None |
None
This action may be used within the following project items: test modules and user-defined actions.
name value
local variable temp count 1
 
 
condition to run
while #temp count<10
 
text
report #temp count
 
name value
local variable temp count #temp count+1
 
 
condition
if #temp count=2
 
exit loop
 
end if
 
end while
- If condition to run evaluates to True, execution returns to the first action line below the associated repeat action line. (That is, another iteration of the repeat/until loop is begun.) If False, execution continues with the lines below the until.
This action ignores letter case for values of True and False, and is unaffected by the current state of the case sensitive built-in setting.
It is acceptable to use numeric expressions in the condition to run argument. TestArchitect treats the value 0 as False, and 1 as True. Note that an error is generated for any other numeric value.
The following operators may be used within an expression in the condition to run argument:
Table 1. Comparison operatorsPrecedence Comparison operator Meaning 4 = equal to 4 <> not equal to 4 > greater than 4 >= greater than or equal to 4 < less than 4 <= less than or equal to
Table 2. Logical operatorsPrecedence Logical operator Meaning 5 not Value is TRUE if its operand is FALSE. 6 and Value is TRUE if and only if both sides of the and operator are TRUE. 7 or Value is TRUE if either side of the or operator is TRUE. Notes:For the full list of operator precedence, see here.- Be careful when using while/end while loops, and in the expressions you use for condition to run. An infinite loop may cause the TA Playback tool to hang.
- To exit a while/end while loop from within the block of action lines, use the built-in action exit loop.