Versions Compared

Key

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

...

Anchor
_Toc481578406
_Toc481578406
Task level IFELSE IF ELSE blocks

Anchor
_Toc481578407
_Toc481578407
Adding IF-ELSE conditional block to task

...

Anchor
_Toc481578408
_Toc481578408
Adding Expression for IF step


Anchor
_Toc481578409
_Toc481578409
Forming expression for IF /ELSE IF:

...

  1. 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 $$_STATUSusing 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.

User 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.


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 with within double quotes.
  2. The expression, having string as data, should always be enclosed with within double quotes.
  3. Boolean values are case-sensitive and should be written in small 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}==true

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

  1. {var1}&{var2}==12



  2. {var1}|{var2}==61



  3. ({var1}^{var2})==49
  4. {var1}^{var2}==49
  5. ~{var1}==-61



  6. ~~{var1}==-61



  7. ~~({var1})==-61
  8. {var1}<<2==240
  9. {var1}>>2==15
  10. {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









Anchor
_Toc481578410
_Toc481578410
Adding ELSE IF block after IF

Anchor
_Toc481578411
_Toc481578411
Adding multiple ELSE IF blocks:

...

Anchor
_Toc481578412
_Toc481578412
Adding ELSE block after IF step

Anchor
_Toc481578413
_Toc481578413
Changes on TestCase screen

...

Anchor
_Toc481578417
_Toc481578417
Adding a TC step and Task step

Anchor
_Toc481578418
_Toc481578418
Storing execution status of TC step

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

Anchor
_Toc481578419
_Toc481578419
IF ELSE blockson Test case screen

...

      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.


Anchor
_Toc481578421
_Toc481578421
Adding tasks in Test Case level IF-ELSE blocks

...

    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"


Anchor
_Toc481578422
_Toc481578422
Adding IF-ELSE blocks to Task in TC

...