25.4 Control Flow Construct Keywords

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 want to verify the If condition. If the If condition is not satisfied then it comes to the Else loop and creates corresponding message. In this case 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 want to end the If loop then “EndIf” 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 compare the output of the previous step:

Common Error conditions

Iteration Keywords

ExitLoop

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 want to exit from the For loop after 3 iterations 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 iterate login steps number of times then 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 login on a web page 5 times. Then instead of using login step keyword 5 times, you can create a for loop by using “for” keyword along with “Next” as follows:

Common Error conditions

Obstruction Keywords

PauseExecution

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. This keyword is used in Debug Mode of test execution only.

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:

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

True

If the keyword passes successfully

Example

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

StopExecution

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.

Article

No items found.
Contact us