We're here to help

Control test steps

Assert


This test step compares the supplied values, failing the test if unsuccessful.  

Drag the Assert test step from the Test Palette into your test case.

 

Then, update the parameters as follows and save the test case.

  • Expected Value: The value that is expected
  • Actual Value: The actual value
  • Operator: See comparison type for the supported comparison types (EqualTo, LessThan, etc.)
  • Failure Message: The message that should be logged if the comparison fails
  • Case Sensitive: Whether the comparison should be case-sensitive or not.  If false then abc = ABC will assert successfully
  • Keep trailing zeros: Whether the comparison keeps trailing zeroes when comparing numbers. By default trailing zeroes are trimmed, e.g. 1.0 becomes 1
  • Nulls are Greater: Whether unpopulated (or null) values should be treated as greater than non-null values.  If true then ‘a < null’ will assert successfully
  • Match Multi-line: The Multiline flag for Regular Expressions
  • Match dot all: The DotAll flag for Regular Expressions

 

Examples:

Actual Value Comparison Expected Value Relevant Checkbox Result
25 Greater Than 24 True – Success
1 Equals 1.0 Keep trailing zeros = false True – Success
Abcd Contains abc True – Success
ABCD Equals Case Sensitive = false True – Success
Abcd Matches bc True – Success

 

Break


Exits the enclosing loop (For Each, While) or Switch.

Drag the Break test step from the Test Palette into your test case:

 Then save the test case.  No parameters are required in this test step.

 

Fail test


While all tests should pass, in some situations it is desirable to temporarily allow particular tests to fail.  This test step fails the test case with a defined message.

Drag the Fail Test test step from the test palette into your test case:

Update the following parameter:

  • Failure Message: The message which should be displayed on test case failure. Then save the test case.

 

Finally


This creates a grouping of test steps that are always executed, even if prior Test Steps have failed. It can be used to run reporting steps, such as updating the test result into a spreadsheet.

Drag the Finally test step from the Test Palette into your test case.

Update the following parameter:

  • Description: The label for the grouping of test steps. Then save the Test Case.

 

For Each


For Loops provide an easy way to traverse arrays. As part of the loop, a variable is created that is incremented after each loop is completed. This variable can be used as the index to an array as well.

Drag the For Each test step from the Test Palette into your test case.

Update the following parameters:

  • List: The item collection list, e.g. {1,2,3,4,5}
  • From Item: A particular value from the collection, e.g. 1
  • Value Name: The value for which need to iterate, e.g. value
  • Continue On Failure: Tick this checkbox if the for-each should continue after failure of any iteration within the loop. Then save the test case.

 

Group Steps


This test step creates a labelled grouping for a number of test steps within your test case. It can be used to make test cases more readable.

Drag the Group Steps test step from the Test Palette into your test case.

Update the following parameter:

  • Description: The label for the grouping of Test Steps. This is visible in the test. Then save the Test Case.

 

If


This test step evaluates a boolean condition to determine which sub-steps will be executed. A different set of sub-steps can be defined for either result.

This test step is most useful for when you need to execute certain steps based on the value of a variable which is set dynamically during the test run. The variable is checked against the expected value, which returns either TRUE or FALSE as output.

Drag the If test step from the Test Palette into your test case.

Update the following parameters:

  • Condition: The IF condition to be evaluated, resulting in an output of TRUE or FALSE
  • Then: This is a grouping of sub-steps which should be executed only when the IF Condition evaluates to TRUE. This grouping is required and is added automatically under the IF step
  • Else: This is an optional grouping of sub-steps which should be executed only when the IF Condition evaluates to FALSE. See below for how to add this clause

To add an Else clause to the If statement, right-click on the If test step and select the Add an Else Clause option:

Then save the test case.

 

Set values


This test step sets the value of one or more test variables, which can then be used in test steps.

Drag the Set Values test step from the Test Palette into your test case.

Update the following parameters:

  • Value Name: The name of the value to set. This can contain sub-values, e.g. Value1.SubValue1
  • Value: The actual value to be set
  • Value Scope: The scope to which the value applies

Then save the test case.

 

Sleep


The Sleep test step suspends test execution for the given number of seconds. The argument can be a floating point number to indicate a more precise sleep time in seconds.

Drag the Sleep test step from the Test Palette into your test case.

Update the following parameter:

  • Sleep For (seconds): The number of seconds that the sleep time should last. Then save the test case.

 

Switch


A Switch statement is used to select one of several alternatives based on the value of an integer, a character, or a string variable. Once a match is found, only the steps in that case will be executed.

Drag the Switch test step from the Test Palette into your test case:

Update the following parameter:

  • Value: The value to switch on case

Switch statements come with one case by default, to add an additional case or a default case, right-click on the Switch test step and select the Add an Case/Default Clause option:

Then save the Test Case.

 

Wait For


This test step is used to wait for a certain condition to occur before proceeding further in the test. You can also define the maximum number of attempts to be made.

Drag the Wait For test step from the Test Palette into your test case:

Update the following parameters:

  • Condition: The condition to be reached for the test to continue. You can define this using the inbuilt editors
  • Test First: Tick this checkbox to test the condition first
  • Max Attempts: The maximum number of attempts to be made
  • Sleep For (seconds): The time in seconds that the sleep time should last
  • Continue on failure: Tick this checkbox if the wait-for should continue after failure

 

Then save the Test Case.

 

While


The While test step executes the contained test steps repeatedly until the specified condition is TRUE or until a break is encountered.

Drag the While test step from the Test Palette into your test case.

Update the following parameters:

  • Condition: The condition to be reached for the test to continue. You can define this using the inbuilt editors
  • Counter Name: The name of the loop counter
  • Start Value: The starting value of the counter
  • End Value: The end value of the counter. Looping will automatically end when this value is passed. If the value is less than the Start Value, then the counter will decrease with each execution instead of increasing
  • Continue on failure: Tick this checkbox if the test should continue after failure

 

Then save the Test Case.