Steps

A robot is made up of steps, which are building blocks in a robot program.

There are five types of steps:

  • Action

  • Try

  • Snippet

  • Group

  • End


My Steps

A step works on a robot state and processes it according to the configuration of the step. A step has an input robot state and generates an output robot state. The only exception is the End step. End steps mark the end of a branch in a robot, but not the end of a robot. For example, the robot does not necessarily stop execution after an end step. End steps are the only steps in a robot that do not have outgoing connections.

Steps may have properties, such as a step name, a list of tag finders, a step action and error handling. While Action steps have all these properties, other types of steps only have some.

The step name provides a symbolic name for the step, such as "Extract Headline" and "Load Search Page." In the preceding robot, the step name is "MyStep".

The finders find the elements (HTML/XML tags or Excel cells) in the page that the step action should work on. Some step actions require a single element, whereas others can handle more than one element. Some step actions accept no elements at all. There are two kinds of finders: Tag Finders that find tags in HTML or XML pages and Range Finders that find cells in Excel pages.

The step action is the action that the step performs. The action is the "heart and brain" of the step, and it is the selection of the right step action that is the challenge of robot writing. For example, an Extract action can extract the text from a tag in an HTML page and store it in a variable. A Click action can load the URL residing in an <a>-tag and replace the page of the current window in the robot state with the newly loaded HTML page. An action usually changes the robot state. For example, the Extract action changes the variables, and the Click action may change the pages/windows, the cookies and the authentications.

A step can be executed. A step that is executed accepts a robot state as input and, by applying the finders and step action in turn, produces an output robot state. The output robot state is then passed to the following step and becomes its input robot state. Some step actions are "termed loop" actions and steps having such actions are called "loop steps." A loop step may generate zero or more output robot states, and cause the following steps to be executed once for each of them.

You can group steps together in expandable Group Steps. The figure below shows an example of an expanded Group step with a collapsed Group step inside it.


Group steps example

A step is valid if it is properly configured so that execution can be attempted. For example, if a step has no action, it is invalid since execution cannot be attempted.

A step definition also specifies error handling.