Versions Compared

Key

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

...

Image Removed

...

Inserting Conditional Blocks

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

Task Level IF ELSE Blocks

Adding IF-ELSE Conditional Block to Task

Image Added

Adding Expression for IF Step

Image Added

Forming Expression for IF /ELSE IF:

Expressions can be entered in for IF and ELSE IF conditional step. User can refer use stored variables, environment variables in expressionas expressions.

  1. You can use Numeric, Boolean comparisons, string values, and arithmetic operators are allowed.
  2. Environment variables and stored variables if used should be included in curly braces in expression.
  3. User can save the execution status of last executed step as $$_STATUS using the StoreVariable keyword action, Or or can directly use $$_STATUS in expression($$_Status is not case sensitive).
    • Using $$_STATUS directly in expression. 

...

Image Added

  • Saving status of step ($$_STATUS) for use in as an expression.

User can save the execution status of a step in variable. This status can later be used in as an expression of IF step.

  • Saving execution status for future reference.

...

Image Added

More For more information 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.

Examples of expressions:and more such variables, click here

Examples of Expressions:

Anchor
Examples of Expressions
Examples of Expressions

Following are some examples of valid/invalid expressions, assuming var1 and var2 as stored variables.

Note

  1. The static or dynamic string data used should always be enclosed within double quotes.
  2. The expression, having string as data, should always be enclosed within double quotes.
  3. Boolean values are case-sensitive and should be written used in small lower case.
}

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
  1. ==true
  2. !({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

Image Removed

...

Image Added

Adding Multiple ELSE IF Blocks:

...

...

Adding ELSE

...

Block After IF

...

Step

...

...

Image Removed

...

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.

...

Adding the Task Step on the TC Screen


You can add the task step using the Add button. After adding the task step, you can add conditional blocks with or without expressions to that step. 

Test Case Level Step (TC step) on the Test Cases Screen

In case you want to avoid adding a task for single step, he you can add Test case level TC step. Add You can then add object, action, and parameters to a TC step just like a task step. 

The 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 :

  • Focus on task and

...

Image Removed

...

  • click the TC Step button. You can then use Up and Down buttons to move the step up or down. 

Adding A TC Step and Task Step

Image Added

Storing Execution Status of TC Step

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

...

Image Added

IF ELSE

...

Blocks on the Test

...

Cases Screen

On the Test case Cases screen users you can add conditional blocks to Task as well as task and Test Case. The Test Case level IF-ELSE blocks can contain tasks , and 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
Image Removed

    1. Adding TC steps to Test Case level IF-ELSE blocks

Steps:

...

You can add the TC or Task condition using the If-Else button from the Testc ases screen.


Image Added

To add TC or Task Condition:

  1. Select TC Step/Task after which you wish to add TC level

...

  1. conditional block.
  2. Click

...

  1. Condition >TC Condition > IF
  2. Select IF step of block, click

...

  1. the TC Step

...

  1.  button to add TC step.
  2. Select

...

  1. recently added TC Step:
    1. click Condition >TC Condition >ELSE IF to add TC level ELSE IF block.

...

    1. click Condition >TC Condition > ELSE to add ELSE block.

...

Image Added

Adding Tasks in Test Case

...

Level IF-ELSE Blocks

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

...

Steps

To add tasks in TC level If-Else blocks:

    1. Select TC Step/Task after which you
  1. wish
    1. want to add TC level
  2. IF-ELSE
    1. conditional block.
    2. Click
  3. on Condition->TC Condition->IF
    1. Condition >TC Condition > IF.
    2. Select IF step of block
  4. ,
    1. and then click
  5. on "
    1. New
  6. Task"
    1. to add new task
  7. ,
    1. or Import
  8. Task to
    1.  to add existing task to
  9. IF-ELSE
    1. the conditional block.
    2. To add Tasks to ELSE-IF or ELSE blocks, select the ELSE-IF or ELSE step of the conditional block and then click
  10. on "
    1. New
  11. Task"
    1. or
  12. "
    1. Import
  13. Task"
    1. .

...


Image Added

Adding IF-ELSE

...

Blocks to Task in TC

StepsYou can add the conditional blocks particularly for task. 

To add conditional blocks to a task from the Test case:

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

...

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

  1. Qualitia validates expression entered by the user and checks if expression is empty or contains assignment (for

...

  1. 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 actual execution of test case.

...

  1. You must enclose stored variables, environment variables in curly braces (for eg: {a}=={b}, or {$$_Status}==0.
  2. Consider 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

      If during execution, OpenUrlis the step OpenUrl is successful, then Task1, Task2 will be is executed. In case of

      If the step OpenUrl fails, then Task3 will be is executed.

      If the OpenUrl has execution status other than 0 or 1, Qualitia executes Task 4 will be executed.

      ...

      ...

      Qualitia's Behavior in case of

      ...

      Invalid Expression:

      • In case If 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 an error and Qualitia will stop execution of test case.
      • In case of dry run (run from Develop screen)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.
      • In case of Suite execution, Qualitia will execute next Test case in sequence. If suite has 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, suite execution will be stoppedstoppped. 

      In all such cases, Error log in reports will explain the reason of execution failure so that users can take corrective actions.