Use standard objects
Standard objects help you structure your test cases and design them to react to specific conditions or criteria.
You can find all logic elements in the left pane of the test case editor, under Standard objects.
This topic is about logic elements. For more information on recovery and cleanup scenarios, check out Use recovery and cleanup scenarios.
Use structural objects
You can group related test steps, so that even complex test flows are easy to read and work with:
-
Go to Standard objects > Structural objects > Test step folder and add the folder to your test case.
-
Drag and drop test steps into the folder.
Use conditions and loops
Conditions and loops give you more flexibility in changing test environments. With a condition, your test case goes through different steps, depending on an evaluation. You don't have to design different test cases to cover the same testing scope.
To use a condition or loop, simply add it onto your test case and add your steps to it.
Conditions and loops consist of these elements:
-
IF: Test steps that you want to evaluate. To evaluate steps, use verifications and the standard module Evaluate expression.
-
ELSE: Test steps that Tosca Cloud performs when at least one test step in your IF fails.
-
WHILE: Tosca Cloud creates a loop that runs test steps repeatedly until the condition is no longer fulfilled.
-
DO: Tosca Cloud creates a loop that runs test steps repeatedly until the condition is no longer fulfilled.
Change the maximum number of repetitions
By default, WHILE and DO loops have a maximum of 30 repetitions. You can change this value. To do so, go to the Properties tab and enter the number of repetitions you want for the maximum.

Logic elements help you structure your test cases and design them to react to specific conditions or criteria.
You can find all logic elements in the left pane of the test case editor, under Logic elements.
If you're in the Cloud Scanner split-screen view, the test case editor looks slightly different and there are certain limitations. You can only group existing test steps, and you can't add if statements to your test case. To add them, you need to leave the split-screen view.
Use groups
You can group related test steps, so that even complex test flows are easy to read and work with:
-
Drop an empty group onto your test case and add your test steps to it.
-
Select multiple test steps in your test case and then
group them.
Use if statements
If statements give you more flexibility in changing test environments. With an if statement, your test case goes through different steps, depending on an evaluation. You don't have to design different test cases to cover the same testing scope.
To use an if statement, simply drop it onto your test case and add your steps to it.
If statements consist of these elements:
-
IF: Test steps that you want to evaluate. To evaluate steps, use verifications and the standard test step Evaluate expression.
-
THEN: Test steps that Tosca Cloud performs when all test steps in your IF pass.
-
ELSE: Test steps that Tosca Cloud performs when at least one test step in your IF fails.
-
WHILE: Tosca Cloud creates a loop that runs test steps repeatedly until the condition is no longer fulfilled.
-
DO: Tosca Cloud creates a loop that runs test steps repeatedly until the condition is no longer fulfilled.
If statement in a test case, with two approaches.
Let's say your test case creates a new order for your shop. During this process, you save the new order number to a variable called Order number.
In the end, you want to make sure that your application shows an order number on the confirmation screen. If it does, Tosca Cloud can close the application. If the application doesn't show an order number, Tosca Cloud should add it, click a confirmation button, and then close the application.
To do this, create this if statement:
-
IF verifies that the Order number field isn't empty.
-
THEN closes the tab with the caption Order confirmation.
-
ELSE uses a variable value expression to enter the order number in the variable Order number. Then it selects the button and closes the tab.
If statement verifies that the Order number field isn't empty
You could also approach this differently:
-
IF verifies that the Order number field shows the same order number that you've previously saved to the variable.
-
THEN closes the tab with the caption Order confirmation.
-
ELSE re-enters the correct order number, selects the button and closes the tab.
If statement verifies that the Order number field shows a specific order number
What's next
Check out other test design elements that help you build better test cases, faster:
You're done building? Do a trial run of your test case, so you can find and fix instabilities before you run your tests in earnest.