Plans
Plans are the implementation of an automation scenario such as a functional test case, a load test, an RPA routine, or even a monitoring probe. They usually combine building blocks called Keywords with various controls in order to reflect the execution logic of the desired automation scenario.
As a beginner, make sure to understand the key concepts explained in the section below before creating your first plan. A walkthrough of a simple plan is also provided as part of our Getting Started guide.
Node types
There are 3 basic types of nodes which can be used within a plan. Click the links in the table below in order to find out more about each type.
the atomic building blocks of a Plan and are designed to be shared between multiple plans | control structures are used to influence the execution flow of the scenario as in any programming language | Plans can call other plans via a special control in order to achieve modular plan design |
Plan formats
There are 3 ways to design, visualize and execute Plans in step. Information on Node types will always be provided in all 3 formats. Click the links in the table below in order to find out more about each format and approach.
The most intuitive way to create a Plan is to use the Visual interface. Design is done visually via drag & drop and buttons | A text representation of a plan, allowing for storage in third party tools such as ALM test case descriptions or as files in a GIT repository | For a programmatic implementation of a plan by a developer, the most advanced way to create and use plans. Javadocs are provided. |
Key concepts
This section contains a description of some of the most important concepts which you need to understand in order to design and execute plans successfully. As part of the Getting Started guide, the creation of a simple plan is described using step’s web-based plan editor.
Plan root
Upon creation of a Plan, a root node will be selected. By default it will be a Sequence, which is the most basic and neutral node in step.
In plain text, the root of your plan will be a Session node by default.
Documentation coming soon…
Depending on the root, child-nodes will be either executed in parallel (for instance, if the root is a TestSet or a TestScenario) or sequentially (Sequence). If you are not sure, make sure to select the default type (Sequence).
Structure & Execution
Plans are implemented by a tree of elements which we refer to as nodes. The order of the nodes in the tree - respective to their parents and siblings - will define the order in which the different nodes will be executed.
Here’s an example of the order of sequential execution of the nodes present in a tree (which is the default case), as displayed in the Visual plan editor:
Variables
Variables are used throughout plans to pass information from a node to another, or to store the result of a dynamic computation.
Variable types
Similarly to any programming language step supports the use of variables in Plans. The variables declared and used in a Plan are called Plan variables. A Plan variable is a container that stores a data value under a certain name.
Like in classical programming languages step supports different types of variables:
- String: stores text (Default type of variables in step)
- int/long/float/double: stores numbers
- boolean: stores values with two states: true or false
- Complex Java objects for advanced data manipulations
When passing or setting a variable into the value field of a control or keyword input, Groovy execution will be required for numbers, booleans and complex java objects. The Groovy toggle is a powerful feature which allows users to add dynamic behavior to a plan “on the fly” without modifying Keywords. See the example provided in the Set controll section below.
Declaring variables
In step you have many ways to declare Plan variables:
- Using the control Set: the most common way to declare a Plan Variable is to use the dedicated control Set in your Plan
- Using Parameters: Parameters declared in the web interface under Parameters are made available to the Plan as Variables
- Using Execution Parameters: Execution Parameters selected at the start of an execution (Environment, etc) are also made available to the Plan as Variable
Set control
Using the Visual Plan Editor you can use the Set control as follow to declare a variable:
This would declare a variable called “myVar” as String and set its value to “This is a string value”.
To declare a variable as integer you could thus use the lightening symbol as follow:
Using the plain-text syntax you can use the Set control as following to declare a variable:
Set city="Basel"
MyKeyword Parameter1="Welcome to ${city}"
Set City="Bern"
MyKeyword Parameter1="Welcome to ${city}"
Similarly to the Visual Plan Editor, you can also use Groovy expressions in the declaration of variables
Set birthyear=2006
Set age=2019-birthday
In this case the variable “birthyear” will be declared as integer. The variable “age” will also be declared a integer as the result of the operation “2019-birthday”
Documentation coming soon…
See also Controls
Parameters
Parameters declared in the web interface under Parameters are automatically declared by step as variables at the begining of the execution and can thus be accessed in the Plan like any other Plan variable.
Execution Parameters
The parameters selected for the execution of a Plan (like “Environment”) are called Execution Parameters. These Execution Parameters are also declared by step as Plan variables at the begining of the execution and can thus be accessed in the Plan like any other Plan variable.
Accessing variables
Variables can be accessed practically everywhere in Plans and can also be passed to Keywords.
Using the Visual Plan Editor you can access previously defined variables in every field that has the lightening symbol as follow:
In this example you would pass the content of the variable “myVar” to the first parameter of the Keyword “My Keyword”.
Using the plain-text syntax you can use the following syntax to access the content of previously declared variables:
Set birthyear=2013
Set age=2019-birthyear
Set city="Lucerne"
MyKeyword Parameter1="I was born in ${city} in ${birthyear} and I am now ${age} years old"
This would call the Keyword “MyKeyword” with Parameter1 set to “I was born in Lucerne in 2013 and I am now 6 years old”
Documentation coming soon…
Undo, redo and discard your changes
It is possible to undo / redo a single modification that you performed while working on a Plan using the top level buttons displayed below :
In addition, it is possible to discard all the changes your performed on a Plan to retrieve its “initial” state by click on the “Discard all” button :
Advanced uses
Links and information about advanced Plan uses are provided here.
Advanced Groovy expressions
Advanced use of Groovy expressions as well as sample plans are provided in our Resources > Library section.
Remote plan invocation
step’s Java client as well as REST API can be used for invoking plans remotely. Check out the stepClient API for more information on remote invocations and triggers.
Interacting with a running plan
The Async semantics provided by the Async & Event plugin allow for real-time interactions with a running plan. One can use the WaitForEvent control to poll the Event queue and influence the plan’s execution logic.