...
Task Level Conditional Blocks
You can add if statementOn the task editor screen, click
Adding Expression for IF Step
- Click the Conditional button, select IF
...
- .
- You can add Else block within an IF block.
Forming Expression for IF /ELSE IF:
...
Data type | Example | Valid/Invalid |
---|---|---|
Any |
| All are invalid as assignment operator is not allowed in expression |
String |
|
|
Integer |
|
|
Float |
|
|
Boolean |
|
|
Logical operators | (var1=true , var2=false)
|
|
Arithmetic |
|
|
Relational Operators |
|
|
Bitwise Operators | (var1=60 , var2=13)
|
|
Special Characters | Using Qualitia Special characters:
Always use escape character ~ before qualitia special characters ~,^,{,} |
|
...
...
Adding the Task Step on the TC Screen
...
In case you want to avoid adding a task for a single step, you can add TC step. You can then add object, action, and parameters to a TC step just like a task step.
...
The execution status of TC step can be stored the same as the task step.
IF ELSE Blocks on the Test Cases Screen
...
- Qualitia validates expression entered by the user and checks if the expression is empty or contains assignment (for example, if user entered a=b which is invalid). Expressions should not have assignment, users should use "==" operator instead. Hence {a}={b} is invalid expression.
- Rest of the syntax and semantics is checked during the actual execution of test case.
- You must enclose stored variables, environment variables in curly braces (for eg: {a}=={b}, or {$$_Status}==0.
- Consider the following test case level conditional block:
- OpenUrl
- IF {$$_Status}==0
Task1
Task2 - ELSE IF {$$_Status}==1
Task3 - ELSE
Task4 - END IF
...
- If the expression is invalid, for example, expression has stored variables referred but not declared, or the syntax of expression is invalid then the test case is considered to have an error and Qualitia will stop execution of test case.
- When execution is triggered using the Dry Run button from the Develop tab and if the expression is invalid, Qualitia stops execution of test case.
- When execution is triggered using the Run Now button from the Execute tab and if the expression is invalid, Qualitia executes next test case. If there is only one test case, execution will be stoppped.
...