Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Qualitia users can add conditional blocks using the IfELSE-Else IF button.  

Task Level Conditional Blocks

On the task editor screen, click  (Add Conditional Expression Block button) to select any of the following conditions:

  • IF
  • Else IF Else
  • Else

Adding Expression for IF Step

  • Click the Conditional Add Conditional Block button, select IF.
  • You can add Else block within an IF block. 

...

  1. Ensure that it is part IF/Else is added after an IF statement.
  2. You can use Numeric, Boolean comparisons, string values, and arithmetic operators.
  3. Environment variables and stored variables should be included in curly braces in expression.
  4. User can save the execution status of last executed step as anyone of the following.
    • Using $$_STATUS directly in expression
    • Saving status of step ({$$_STATUS) for } for use as an expression.
      User can save the execution status of a step in variable. This status can later be used as an expression of IF step.
    • Saving execution status for future reference. You need to use StoreVariable Action and in the second parameter column enter as "{$$_Status}".  For more information about $$_Status and similar variables, refer to Qualitia System Variables

...

The execution status of TC step can be stored the same as the task step.

ELSE IF

...

Blocks on the Test Cases Screen

On the Test Cases screen you can add conditional blocks to task and Test Case. The Test Case level ELSE-IF -ELSE blocks can contain tasks and the contained tasks in turn can have task level ELSE-IF -ELSE blocks.

Adding

...

the ELSE-

...

IFBlocks to Test Case

You can add the TC or Task condition using the IfELSE-Else IF button from the Test cases screen.

...

  1. Select TC Step/Task after which you wish to add TC level conditional block.
  2. Click Condition Add Conditional Block >TC Condition > IF.
  3. .Select IF step of block, click the TC Step button to add TC step.
  4. Select recently added TC Step:
    1. click Condition Click Add Condition Block >TC Condition >ELSE IF to add TC level ELSE IF block.click Condition 
    2. Click Add Condition Block >TC Condition > ELSE to add ELSE block.
      Note: If you want to add an Else-If or Else condition, it must be added after the If condition. 

Adding Tasks in Test Case Level ELSE-IF

...

Blocks

You can add new tasks or import tasks from the existing library of tasks inside the conditional blocks. 

To add tasks in TC level IfELSE-Else IF blocks:

  1. Select TC Step/Task after which you want to add TC level conditional block.
  2. Click Condition >TC Condition > IF.
  3. Select IF step of block and then click New to add new task or Import to add the existing task to the conditional block.
  4. To add Tasks to ELSE-IF or ELSE blocks, select the ELSE-IF or ELSE step of the conditional block and then click New or Import.

    Note: If you want to add an Else-If or Else condition, it must be added after If condition. 


Adding ELSE-IF

...

Blocks to Task in TC

You can add the conditional blocks particularly for task. 

...

  1. Create a new test case and add required tasks to it. 
  2. Select the step after which the conditional block needs to be added, or the task row to which the block needs to be added.
  3. Click the If-Else Add Conditional Block button > Task Condition > IF.
  4. Once If block is added to task, ELSE IF or ELSE blocks can be added by selecting proper task step and using the IfELSE-ElseIF button. 
  5. For adding expression, double-click IF or ELSE IF.
  6. Use the syntax of expression is as described earlier.

Execution flow of conditional (ELSE-IF-ELSE) blocks will be as follows:

  1. 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.
  2. Rest of the syntax and semantics is checked during the actual execution of test case.
  3. You must enclose stored variables, environment variables in curly braces (for eg: {a}=={b}, or {($$_Status}==0.
  4. Consider the following test case level conditional block:
    1. OpenUrl
    2. IF {$$_Status}==0
      Task1
      Task2
    3. ELSE IF {$$_Status}==1
      Task3
    4. ELSE
      Task4
    5. END IF

...