Testing and Debugging Robotic Processes

Testing a robotic process is an important step before deploying it to production environments. You want to make sure that the robotic process executes properly and is set up to handle changes or unexpected situations.

This page outlines some ways to test your process and solve common problems during the bug fixing process.

When you're ready to test, the first step is to execute a robotic process using the method that fits your use case. Developers usually execute the process manually.

Check the execution log

Your first step when troubleshooting a robotic process should be to check the execution log:

  1. Go to the Robotic processes tab.
  2. In the table, click the name of the process you're interested in.
  3. In the list of executions, click the name of the execution you're interested in.
  4. Click the Execution log tab. This is the detailed list of each operation the robotic process took during execution, including timestamps.
  5. At the top of the Execution log, you can filter the log entries by trace types:
    • Statistics
    • Dump contribution
    • Result files
    • Screenshots
    • Work items OK
    • Work items WARN
    • Maximum trace level
    • Debug trace level
    • Info trace level
    • Error trace level
    • Fatal trace level
  6. You can view or download the full trace to see even more details about the outcome of the execution. Use this information to pinpoint how to best modify the robotic process code or configuration.

Other solutions to common pitfalls include:

  • Ensure that an appropriate resource was chosen for execution.
  • Verify permissions are properly configured.
  • Ensure that the execution successfully connected to the repository and downloaded the required libraries.
    • Confirm that the credentials in the robotic process configuration are accurate.
  • Once proper initiation is confirmed, follow the log messages as configured in the code to troubleshoot further, especially WARN and ERROR level messages.

When in doubt, open a support case with Appian Support and attach the execution log.

Debug in your IDE

One of the most important features to use while developing a robot is the ability to debug it. To do so, we can perform what's called remote debugging.

We call it remote debugging because we are assuming that the robotic process will run on a different machine from the one used by the person who wants to debug the process.

Let's see how to enable this remote debugging and how to use it.

Resource configuration

First, you'll need to configure the resource.

8028358.png

  1. In the agent, select the option Generate configuration file.
  2. Select the option Enable debug in Debug Settings. This will generate a file include the required configuration to accept debug connections through the port 13000. Be aware that that port must be accessible from the development machine (where our IDE is) to the resource.

8028344.png

It is possible that, in a development resource, the agent may be already configured to accept incoming connection for debugging through port 13000. If this is not the case, it is possible to enable remote debugging through a configuration file where it is possible to specify, among others, which port will be used for debugging.

This file, usually called jidoka.l4j.ini, is optional and makes it possible to add specific configuration to the resource JVM. In this file, basically a properties file, we must add the following line to enable remote debugging:

1
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=[PORT]

Where we want to replace [PORT] by the port through debugging will be enabled. This port must be available and be capable of receive incoming connections for debugging.

It might be the case the provided agent is already configured to accept incoming connections for debugging through port 13000. However, this option is disabled by default, so it is necessary to have been requested previously.

Eclipse configuration

Next, you'll need to configure Eclipse.

To be able to remotely debug a robot, we must add a remote Java machine within the debugging settings.

  1. In Eclipse, open the Debug Configurations menu.
  2. Right click on Remote Java Application and select New.

    2235822.png

  3. Set up the debugging values, using the information related to the machine on which the robot will run, that is, the server (Host) and the port (Port). In addition, we must provide information about the project with the source code.

Agents have enabled the port 13000 for remote debugging.

The deployed robot to be executed must match with the version of the code that we want to debug.

2235832.png

Connect to a remote machine

Once we have applied the configuration by clicking on the button Apply, we can start debugging by clicking on the button Debug. By doing so, we establish the connection, and so we will still need to set the necessary breakpoints for the debugging.

From the Eclipse Debug perspective, we can see that we are connected and ready for debugging once the robot execution starts.

We will able to see the threads that are running on the remote machine.

You don't need to click Debug each time we want to debug a robot. Once connected, we will be able to debug each robot execution until the connection is closed.

2235834.png

Making changes in the code as we are debugging is quite common. For this reason, be aware that if you change the code, it is no longer synchronized with the deployed robotic process's code. Although you don't need to reconnect with the remote machine, you can redeploy the robot directly to synchronize again the robot and the code.

Every time you change your code and save it, Eclipse will show you a warning message, because Eclipse cannot know whether the code matches with the execution we are debugging or not.

2235830.png

Debugging

It's time to debug our robotic processes.

By now, you are already connected with the machine on which the robot is running. You need two more things: to establish breakpoints to stop the execution and to launch the robot.

In the image below, we can see the breakpoints already established.

2235828.png

You can launch the robot and wait for the execution to stop, so that you can debug step by step.

2235826.png

From this point on, you can use the usual commands for debugging. From the Display view, you can write and run any set of lines of code, without the need for including them in the debugged software.

2235833.png

2235821.png

To run code from the Display window, write the code, select it, and press the keys Ctrl + Shift + D. You can also right-click and pick the option Display from the menu. We can also pick the option Inspect, but this way we will get the result on a pop-up window, rather than on the display view.

2235823.png

Execute a robotic process

After you've debugged, execute the robotic process in your test environment.

Open in Github

On This Page

FEEDBACK