17.3 Control Flow Construct

Comment Keywords

Comment

This keyword is used to write comments for any Test flow or Test scenarios. This keyword is mostly used in situations where you want to mention any explanations for testers or users regarding the testing scenarios. Comments are always user defined.

Input Arguments

Example

If you have created a Test flow and you want to mention comment for it, then you can use the Comment keyword as follows:

# Comment

This test flow is created to test the proper flow of execution of login process.

Common Error conditions

There are no error conditions for this keyword.

Condition Keywords

Else

This keyword is used to provide an alternative scenario to be executed; when IF condition fails. It is always executed along with “If” keyword. It does not take any Object or data  input arguments.

Input Arguments

Output

Example

Let us consider a test flow where you have to click on an object if (5>6) otherwise an image will get clicked, then you can use “else” keyword as follows:

Common Error conditions

EndIf

This keyword is used to declare End of If block in your test case. This keyword is always used with If statement.

Input Arguments

Note: It is mandatory to use If statement while using EndIf.

Output

Example

Let us consider a test flow where you have to apply a condition that If 50 > 10 then an Image will be clicked then “if” keyword can be used as shown below:

To declare End of If block in your test case you need to use EndIf statement.

Common Error conditions

If

This keyword is used to use conditional logic in your test case. This keyword is mostly used in situations where you want make a test flow in which the Test steps are based on some conditions.

Input Arguments

Output

Example

Let us consider a test flow where you have to apply a condition that If 50 > 10 then an Image will be clicked then “if” keyword can be used as shown below:

This keyword will test the condition whether 50 is greater than 10. If the result will be true then it will execute the test steps further otherwise it will directly execute the EndIf statement.

Common Error conditions

Iteration Keywords

Exit Loop

This keyword is breaks out of For-Loop.It Supports breaking out of multi level nested loops. This keyword is mostly used in situations where you need to take exit from one of the loop among several nested for loops.

Input Arguments

Output

Example

Let us consider a test flow where you have used two nested for loops with “String Concat” keywords upto 2 iterations.Now, you wish to exit from loop 1 after the first iteration then “ExitLoop” keyword can be used as shown below:

ExitLoop

Common Error conditions

For

This keyword is used for looping or repeating a set of keywords for some specific number of iterations(repetitions). It is always executed along with “Next” keyword. It takes number of “Iterations” as the data input arguments.

Input Arguments

Output

Example

Let us consider a test flow where you have to click on an object 5 times. Then instead of using “click” keyword 5 times, you can create a for loop by using “for” keyword as follows:

For

Common Error conditions

Next

This keyword is used to end the “for” loop iteration. It is always executed along with “For” keyword. It does not take any Object or data  input arguments.

Input Arguments

Output

Example

Let us consider a test flow where you have to click on an object 5 times. Then instead of using “click” keyword 5 times, you can create a for loop by using “for” keyword along with “Next” as follows:

Common Error conditions

Obstruction Keywords

Pause Execution

This keyword is used to pause the ongoing execution. This keyword is mostly used in situations where you want to pause the ongoing execution after certain Test Steps.

Input Arguments

Output

Example

Let us consider a test flow where the user has logged in to a website and now want to pause the execution then “pause execution” keyword can be used as shown in the screenshot below:

This keyword will pause the ongoing execution and then the execution can be resumed manually.

Common Error conditions

There are no error conditions for this keyword.

Sleep

This keyword is a static sleep and it waits (sleeps) for specified time (sec). This keyword takes seconds as Data input arguments

Input Arguments

Output

Example

If you want to wait for a while after Opening any browser then use “Sleep” keyword as shown below

Sleep

Common Error conditions

There are no error conditions for this keyword.

Stop Execution

This keyword is used to stops the ongoing execution. The Final PASS/FAIL status would depend on steps executed until this point is reached.

Input Arguments

Output

Example

Let us consider a test flow where the user has logged in to a website and now want to stop the execution then “stop execution” keyword can be used as shown below:

StopExecution

Common Error conditions

There are no error conditions for this keyword.

Contact us