Adding Conditional Blocks
Inserting Task Level IF-ELSE Blocks
Adding ELSE IF block after IF
Adding Multiple ELSE IF Blocks
Adding ELSE Block after IF Step
Adding Expression for IF Step
Adding IF-ELSE Blocks to Test Case
On Test Case screen, users can add conditional blocks to Task as well as Test Case. Test Case level IF-ELSE blocks can contain tasks, the tasks contained in turn can have task level IF-ELSE blocks.
With this version of Qualitia, new button "If-Else" is added at top right, click "If-Else" to add Task level or TC level IF ELSE blocks.
Use the following steps to add a Test Case level If-ElseIf-Else block:
- Focus/Select TC Step/Task after which you wish to add TC level IF-ELSE block.
- Click on Condition->TC Condition->IF.
- Select IF step of block, click on "TC Step" to add TC step.
- Select TC step, just added and click on Condition->TC Condition->ELSE IF to add TC level ELSE IF block. Or Condition->TC Condition-> ELSE to add ELSE block.
Adding tasks in Test Case level IF-ELSE blocks
Use the following steps to add one or more tasks in a TC level IF-Else Block.
- Select TC Step/Task after which you wish to add TC level IF-ELSE block (within which you wish to add a task).
- Click on Condition->TC Condition->IF.
- Select newly added IF step of block, click on "New Task" to add new task or Import Task to add existing task to IF-ELSE block.
- To add tasks to ELSE-IF or ELSE blocks, select the ELSE-IF or ELSE step of conditional block and click on "New Task" or "Import Task".
Adding IF-ELSE blocks to Task in Test Case
Use the following steps to add If-Else block to a task in a TC.
- Create a new test case and add a new/existing task to this test case.
- Select the step of the task after which the conditional block needs to be added, or the task row to which the block needs to be added.
- Click on Condition->Task Condition->IF.
- Once If block is added to task, ELSE IF or ELSE blocks can be added by selecting proper task step and clicking on Condition->Task Condition->ELSE IF or Condition->Task Condition->ELSE.
- For adding expression, double click IF or ELSE IF.
- Syntax of expression is as described in following sections.
Forming Expression for IF /ELSE IF
Expressions can be entered in IF and ELSE IF conditional step. User can refer stored variables, environment variables in expression.
- Numeric, Boolean comparisons, string values and arithmetic operators are allowed.
- If you use Environment variables and stored variables, you must include them in curly braces in an expression.
- You can save the execution status of last executed step as $$_STATUS using StoreVariable keyword, Or directly use $$_STATUS in expression ($$_Status is not case sensitive).
- Using $$_STATUS directly in expression.
- Saving status of step ($$_STATUS) for use in expression.
You can save the execution status of a step in variable. This status can later be used in expression of IF step.
- Saving execution status for future reference.
More about $$_Status
- $$_Status is not case sensitive
- It gets overridden after each step is executed, hence can store the status of last executed step only.
Values of $$_STATUS variable
Value
Description
0
Success
1
Fail
2
Defect
-1
Not executed
- $$_Status does not store any status for conditional steps like "IF", "ELSE IF", "ELSE" and "END IF".
- If a user declares environment variable named "$$_STATUS", its value is ignored.