How To Use Local Files in Robots

Robots are able to load many types of files including HTML, Excel, CSV, and regular text files. This enables robots to extract data from a variety of sources.

There are in general two different procedures when loading various file types. If the file is located on the Internet, it is simply loaded using the Load Page action, specifying the URL of the file or using the Click action, clicking a link to the file. This automatically loads the file up in the page view. On the other hand, if the file is located on your system, it is beneficial to load the file in the following way to ensure that the file is also available upon uploading the robot to the Management Console to be scheduled or added to a Kapplet.

All file types, except PDF, are loaded in the following way:

First, add a binary type variable to the robot. (Other variable types like PDF and HTML can also be used, but are not as flexible as the binary type and may not permit user input.)

A variable with an attribute of the type binary is added to a robot. It is defined as an input variable to allow users to input other files in Kapplets and Schedules. For test in Design Studio, an excel file is loaded into the attribute by using the "Load..." button.

When adding the variable, make sure to check whether the variable should be an input variable. The difference between checking and not checking "Use as Input" only matters if the robot is to be scheduled or used in a Kapplet in the Management Console. An input variable is definable by the user, and so the file will be interchangeable for each time the robot is run. On the other hand, if the file should be the same each time the robot is run, then there is no need to use an input variable. Finally, use the "Load..." button to load a test file (this will also be the final file if "Use as Input" was not checked).

Once the file has been loaded into the binary type variable, Create Page is used to load the file into the Page View. Before the step works, it should be configured to load the correct type of file.

To load the file content from the binary variable, a Create Page step is used. For the Contents field, the value selector is set to variable, and the binary type variable is chosen. Afterwards the step is configured to load the correct type of content.

The Create Page step is configured to load the correct type of content from the binary variable. In this case, Excel is chosen.

Under the Page Loading tab of the step configuration, Page Content Type is set to "Same for All Pages", and the Content Type is chosen as the same as the file loaded.

The Create Page step now loads the file into the Page View.

Upon following the steps given above, the Create Page step should now load the file into the Page View. To load PDF files, see the Extract from PDF reference. To use an input file for a schedule, please see Adding a single Robot.