How to Write a Robot with Input Variables

Robots taking input variables are probably the most advanced kinds of robots that you can write in Design Studio because the requirements of these robots are often quite strict. Generally, they should be speedy and highly reliable. (These requirements might, of course, apply to all robots; however, typically robots taking input variables are executed in real-time whereas normal extraction robots are executed in batch; also, extracting values incorrectly is typically less critical than filling out a bank transfer incorrectly.)

Let us look at the speed and reliability requirements in turn.

The speed requirement can be fulfilled through optimization. In Design Studio, the step actions involved with navigation, i.e. Click and similar actions, consume by far the larger part of the total execution time (80% or more). Hence, you should avoid any needless navigation whenever possible. One way to eliminate needless navigation is by linking directly to the relevant information. For example, instead of navigating to a login form from the front page you should load the login form directly. Sometimes, such direct navigation is not possible because of sessions and cookies, but often it is.

The reliability requirement involves writing the robot in such a way that it either carries out its task smoothly, or reports that it cannot. This is not as easy as it may sound. In fact, there are situations in which a robot cannot possibly know whether it succeeded or not. For example, if the robot submits an order and the web site does not transmit a response, then what happened? (You have probably tried something similar yourself in a normal browser.) However, a robot should be written so that it minimizes such uncertainties whenever possible. In more concrete terms, each time the robot interacts with some uncertain element (such as a web site), it should analyze the interaction thoroughly in order to detect possible errors. If an error is detected, then it should be reported, usually in the form of a returned value that somehow tells the application that invoked the robots what went wrong. If no errors are detected, then the robot can proceed to its next action. See How to Make Robots More Robust for more information.

When writing robots taking input variables, you use, more or less, the same step actions and data converters as for any other kind of robot. However, some step actions and data converters are especially useful with robots taking input variables. You should check the reference documentation on the following items: