# Debug Menu

**Debugging** is the process of finding and fixing errors in a Robot script. It is recommended to perform it at all key stages of the project for step-by-step control.

In Sherpa Designer, in addition to local robot debugging, [remote robot debugging](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/menyu-otladka/udalennaya-otladka-robota) is available, as well as the ability to build a diagram in debug mode, as demonstrated in the video:

* Building a diagram in debug mode:

{% embed url="<https://sherparpa.ru/ucontent/?D0>" %}

* Working with browsers when building a diagram in debug mode:

{% embed url="<https://sherparpa.ru/ucontent/?D1>" %}

Main tools for debugging and testing in Sherpa RPA:

* **Debug Mode with breakpoints;**
* **Console for checking variables;**
* **Logging for monitoring critical points.**

There are also other advanced features of [Try-Catch](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/spravochnik-blokov/osnovnye-bloki-main-blocks/try-catch-trycatchcontainer), as well as [remote debugging](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/menyu-otladka/udalennaya-otladka-robota).

## Debugging Example

Let's consider a task where it is required to develop a Robot to transfer data from Excel to a web form. We will build it using basic debugging tools:

* Add a block to load data from the Excel document.
* Upload the data table and fill in the file path.
* Add a block "Get Cell Value". In its properties, specify the table name, row number, and column number. The result will be written to the variable email.

> This step is critically important. An error when reading data will jeopardize the entire subsequent script, so be sure to include a check. If you set a breakpoint directly on this reading block, you will not check anything because the breakpoint pauses execution before the block it is set on. You will see the system state before the data was read.

* Add a block "Set Text", and in its properties specify where to write the obtained email. Set the first breakpoint on it.
* Go to the Debug tools on the top panel and set a breakpoint on this block (by pressing F9 or through the context menu). The block will be highlighted with a red frame.
* Start debug mode by clicking on the top panel or pressing Ctrl+F6. The script execution will stop at the breakpoint. Additionally, the block where the program execution is currently stopped will be outlined with a blue rectangle.
* Check the Robot, for this go to the [Console](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/broken-reference) at the bottom of the interface. The variable email will display an incorrect value. Since numbering starts from `0`, in the properties of the block, you need to change the row to `0` and the column to `1` (this is a column binding error). Run debug mode again and check that the value of the variable email is now correct.

## "Run" Button

The “**Run**” button in the development menu allows you to start the execution of the project (main and nested diagrams) by the Robot without debugging or pause its execution. This button activates the Sherpa Robot agent, and the Sherpa Designer window minimizes. Also, when you click the “Run” button, the entire project is automatically saved. Clicking on the icon below the “Run” button will open a dropdown list of launch options.

* The option “**Run Active Diagram Without Debugging**” allows the active diagram to run without debugging. Also, to run the active diagram without debugging, you can use the keyboard shortcut Ctrl+F5.
* The option “**Run in PiP Mode**” allows you to start the project execution with display in a separate Robot launch window.

<figure><img src="https://3199517203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4mXXYsqBuhj7RyX6Y4Yw%2Fuploads%2Fgit-blob-c2609f5630ad40cc31adea7569d2566380fbf0e7%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20(66).png?alt=media" alt=""><figcaption></figcaption></figure>

## "Debug" Button

The “**Debug**” button in the development menu allows you to run the current project in debug mode. Unlike the regular run mode, in this mode, it will be possible to stop the execution process at breakpoints and execute the process step by step. Also, when you click the “Debug” button, the entire project is automatically saved. Clicking on the icon ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc4Nsyy5setgxJEa9bpT0agD1x-Ke9XxVfjdA0N_SOvtUz7rge5KSAkWS2KgXbC4_iqli5p4-CmJ3tYuCJUJlLKj4Etqe1ydxXWxC6nRZsnZ_vUJpi1ynT_sBIYSFEzHO6pru880g?key=0bB9k7xLUHniK5eOXmSGqg) to the right of the “Debug” button will open a dropdown list of debugging options.

* The option “**Debug Active Diagram**” allows you to start debugging the active diagram. Also, to debug the active diagram, you can use the keyboard shortcut Ctrl+F6.
* The option “**Debug from Current Block**” allows you to start debugging from the current block. Also, to debug from the current block, you can use the keyboard shortcut Ctrl+Shift+F6.
* The option “**Debug Settings**” allows you to specify parameter values that will be used when starting the project in debug mode if input parameters are specified in the Project Properties. By setting input parameter values, you can start debugging the project with these input parameters.

<figure><img src="https://3199517203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4mXXYsqBuhj7RyX6Y4Yw%2Fuploads%2Fgit-blob-cbe5c1ebf185d3769b048aefc89361ceff4c6526%2F2025-07-22_22-49-08.png?alt=media" alt=""><figcaption></figcaption></figure>

Debugging from the current block is demonstrated in this video:

{% embed url="<https://sherparpa.ru/ucontent/?TZjc>" %}

## "Breakpoint" Button

The “**Breakpoint**” button in the development menu allows you to pause the execution process of the script to view the results of its execution. The step at which the Robot will pause the project execution. Using the "Breakpoint" button before or during the project launch, you can mark the necessary blocks where the process should be paused – and the process will automatically pause when its execution reaches these blocks.

<figure><img src="https://3199517203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4mXXYsqBuhj7RyX6Y4Yw%2Fuploads%2Fgit-blob-201ca5aae6acd7e61cc3768ca0a54b87080a434c%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20(67).png?alt=media" alt=""><figcaption></figcaption></figure>

## "Step Forward" Button

The “**Step Forward**” button in the development menu allows you to start or continue the execution of the project until the next block and then pause the execution, but for subprocess blocks, the next stop will occur in the current diagram at the next block after the subprocess (that is, the entire subprocess will be executed completely).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcIHmuH1Sk5YvC4K2OZSrDXRQEaEYELdzYBjcQjHAO9epkteDHEiy8Njgm-Jb4M4F1bwX4HBMzdjaV4bpp3V1QeDHH47qi8AljynS7TdslT1oh4LZX-5US1lXq9Mh_gUCF9Mi5d?key=0bB9k7xLUHniK5eOXmSGqg" alt=""><figcaption></figcaption></figure>

## "Step Into" Button

The “**Step Into**” button in the development menu allows you to start or continue the execution of the project until the next block and then pause the execution, but for subprocess blocks, the next stop will occur at the first block of the subprocess diagram.

If the current block is not a subprocess block, then the actions "Step Forward" and "Step Into" will look the same.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf4nI5imTXQsdxr0p33I3hxnBpOwU8ytWdvSAZMrSTKWu-5OoE6gbg6C21n60UF8K2_GrWWW16HQPXPMoMkpEU1gG5luDU6Kc6-z2C_0c_J2OmpKGaY2IsERvmct3ZSLAcfgmCMug?key=0bB9k7xLUHniK5eOXmSGqg" alt=""><figcaption></figcaption></figure>

## "Stop" Button

The “**Stop**” button in the development menu allows you to terminate the Robot's operation and return to development mode.

<figure><img src="https://3199517203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4mXXYsqBuhj7RyX6Y4Yw%2Fuploads%2Fgit-blob-5af0daca83bdb4a1ee090f6f659022ef29a39c06%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20(68).png?alt=media" alt=""><figcaption></figcaption></figure>

## Recommendations for Debugging and Testing RPA Processes

To ensure the reliable operation of bots in production and prevent unexpected errors, it is necessary to adhere to the following principles and debugging methods:

1. **Check Each Variable, Condition, and Selector**\
   Before launching and publishing, ensure that all variables and conditions are set correctly, and selectors work accurately. This will help avoid errors during execution and ensure stable bot operation.
2. **Design with Validation**\
   Include data checks when creating process steps. Using built-in validation mechanisms allows you to identify incorrect data at early stages of development.
3. **Interactive Development and Testing**\
   Use the debugger to run individual fragments of the process as they are ready. This allows you to quickly identify and fix errors without waiting for the final assembly of the entire process.
4. **Adding Checkpoints**\
   As a standard practice, implement logging checkpoints and stop messages. This facilitates quick problem detection and enhances the manageability of development.
5. **Testing All New Blocks and Logical Links**\
   Regularly check the operation of each block or link during development to ensure their correct functioning.
6. **Monitoring Variable Values**\
   Monitor variable values in real-time during process execution to timely detect discrepancies or errors.
7. **Logging Important Events**\
   Maintain an execution log with a focus on key moments and events of the process. This significantly eases error analysis and improves support quality.

Following these recommendations will help create more resilient, faster, and higher-quality automation processes, as well as enhance your professional level in the field of RPA.
