Versions Compared

Key

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

...

How to insert conditional blocks

...

...

Task level IF ELSE blocks

...

Adding IF-ELSE conditional block to task

...

...

Adding Expression for IF step


...

...

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.

...

Data type

Example

Valid/Invalid

Any

  1. var1=2
  2. var1=var2
  3. var1*=1
  4. var1+=2
  5. var1++
  6. var1=var2+2==10

All are invalid as assignment operator is not allowed in expression

String

  1. ""India"=="India""
  2. ""{var1}"=="{var2}""
  3. India==India
  4. {var1}=={var2}


    (var1 and Var2 are stored variables containing string values)

  1. Valid
  2. Valid
  3. Invalid

    (The string data passed not specified in quotes "" also the whole expression is not inside "")
  4. Invalid
    (Variables containing string data are not specified in quotes "" also the whole expression is not inside "")

Integer

  1. 1==1
  2. {var1}=={var2}
  3. ""1"=="1""
  4. ""{var1}"=="{var2}""


    (var1 and Var2 are stored variables containing integer values or numbers)
  1. Valid
  2. Valid
  3. Valid
  4. Valid

Float

  1. 1.254==1.345
  2. {var1}=={var2}


    (var1 and Var2 are stored variables containing Float values)
  1. Valid
  2. Valid

Boolean

  1. true==true
  2. false==false
  3. TRUE==TRUE
  4. FALSE==FALSE
  5. {var1}=={var2}


    (where var1 and var2 can have value either true or false)
  1. Valid
  2. Valid
  3. Invalid

    (Boolean values are case sensitive. Boolean values should be passed in small case).
  4. Invalid
  5. Valid

Logical operators

(var1=true , var2=false)

  1. {var1}&&{var2}==false
  2. {var1}||{var2==true
  3. !({var1}&&{var2})==true
  1. Valid
  2. Valid
  3. Valid

Arithmetic
Operators

  1. 1+1==2
  2. 1-1==0
  3. 2*2==4
  4. 8/2==4
  5. 9%2==1
  1. Valid
  2. Valid
  3. Valid
  4. Valid
  5. Valid

Relational Operators

  1. 1==1
  2. 1!=2
  3. {Var1}<{var2}
  4. {var1}>{var2}
  5. {Var1}<={var2}
  6. {var1}>={var2}
  1. Valid
  2. Valid
  3. Valid
  4. Valid
  5. Valid
  6. Valid

Bitwise Operators

(var1=60 , var2=13)

  1. ({var1}&{var2})==12
  2. ({var1}|{var2})==61
  3. {var1}&{var2}==12
  4. {var1}|{var2}==61
  5. ({var1}^{var2})==49
  6. {var1}^{var2}==49
  7. ~{var1}==-61
  8. ~~{var1}==-61
  9. ~~({var1})==-61
  10. {var1}<<2==240
  11. {var1}>>2==15
  12. {var1}>>>2==15
  1. Valid
  2. Valid
  3. Invalid
    (Outer () are required,otherwise interpretation goes wrong and it may return false)
  4. Invalid
    (Outer () are required,otherwise interpretation goes wrong and it may return false)
  5. Valid
  6. Valid
  7. Invalid
    (~ itself is a qualitia special character)
  8. Valid
    (escape character ~ is followed by complement operator ~)
  9. Valid
  10. Valid
  11. Valid
  12. Valid

Special Characters

Using Qualitia Special characters:

  1. ""a~xyz"== "a~xyz""
  2. ""a~^xyz"== "a~^xyz""
  3. ""a~{xyz"== "a~{xyz""
  4. ""a~{xyz"== "a~{xyz""


    Always use escape character ~ before qualitia special characters ~,^,{,}

    For any other character no escape character is required.
    e.g ""as#gh%ff"==" as#gh%ff""




All are valid

...






Adding ELSE IF block after IF

Anchor
_Toc481578411
_Toc481578411
Adding multiple ELSE IF blocks:

...

Adding ELSE block after IF step

...

Image Removed

...

Adding the Task step on the TC screen

With this version of Qualitia, a new button "Task Step" is provided to add step to the task.OnTestCase screen, create a new task and click on "Task Step" button to add step to the task.

...

...

Test

...

Case level step (TC step) on

...

the Test Cases screen

In case if user wants to avoid adding a task for single step, he can add Test case level step. Add object, action and parameters to a TC step just like a task step.
TC  TC step can be added at any position, after or before a task or even as a first step of test case.

To add TC step before a Task focus on task and add TC step, then focus on that TC step and click on "Move Up".

...

Adding a TC step and Task step

...

Storing execution status of TC step

The execution status of TC step can be stored same as Task step.
Image Removed

...

Image Added

IF ELSE blocks on Test case screen

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 contained tasks in turn can have task level IF-ELSE blocks.

...

...

Adding IF-ELSE blocks to Test Case

With this version of Qualitia, new button "Condition" is added at top right, click "Condition" to add Task level or TC level IF ELSE blocks

...

      1. Focus/Select TC Step/Task after which you wish to add TC level IF-ELSE block
      2. Click on Condition->TC Condition->IF
      3. Select IF step of block, click on "TC Step" to add TC step
      4. 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

Steps:

    1. Select TC Step/Task after which you wish to add TC level IF-ELSE block
    2. Click on Condition->TC Condition->IF
    3. Select IF step of block, click on "New Task" to add new task, or Import Task to add existing task to IF-ELSE block.
    4. 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 TC

Steps:

      1. Create a new test case, add task to this test case
      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 on Condition->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 clicking on Condition->Task Condition->ELSE IF or Condition->Task Condition->ELSE.
      5. For adding expression, double click IF or ELSE IF
      6. Syntax of expression is as described earlier.

...

Execution flow of conditional (IF-ELSE) blocks

  1. Qualitia validates expression entered by user and checks if expression is empty or contains assignment (for Example 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 actual execution of test case.
  3. Users must enclose stored variables, environment variables in curly braces (for eg: {a}=={b}, or {$$_Status}==0.
  4. Consider following test case level conditional block:
  5. OpenUrlurlOpenUrl
  6. IF {$$_Status}==0
    Task1
    Task2
  7. ELSE IF {$$_Status}==1
    Task3
  8. ELSE
    Task4
  9. END IF

If during execution, OpenUrlis successful, then Task1, Task2 will be executed.
In case of OpenUrl fails, then Task3 will be executed.
If OpenUrl has execution status other than 0 or 1, Task 4 will be executed.

...

Qualitia behavior in case of invalid expression:

  • In case the expression entered by user 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 error and Qualitia will stop execution of test case.
  • In case of dry run (run from Develop screen), Qualitia stops execution of test case
  • In case of Suite execution, Qualitia will execute next Test case in sequence. If suite has only one test case, suite execution will be stopped.
  • In all such cases, Error log in reports will explain the reason of execution failure so that users can take corrective actions.

...