It debugs me that not enough people are using this amazing feature! Let's see how it works.
Watch the video above or read the key points below to get started!
What does the Debug tool do?
The Debug tool you to see each line your bot is executing during runtime, as well as details on how your variables are currently being filled. Once on Debug mode you will be able to pause/run your bot line by line, while seeing values being processed in real-time. This is especially helpful for longer or more complex bots and when inspecting your code while checking for bugs.
How to use it
While editing your bot, click on “Debug” at the top-right of the Workbench – alternatively you can press “F10” on your keyboard. Now the only visible lines of code are the ones your bot will use during this run, as all disabled lines will be hidden. This offers a clearer view of what your bot will be processing. Adding Breakpoints enables you to control the bot execution, as the bot pauses for each breakpoint added and provides the ability for developers to step through code manually. To create a breakpoint, click on the line number if you are on List View, or using the vertical ellipsis menu on Flow View. As an alternative, you can also highlight any action(s) within your bot and press “F9” on your keyboard to toggle on/off breakpoints for the selected actions. After you start your bot on Debug mode, you can:
- Step Out: Run your bot automatically pausing it once it encounters a breakpoint.
- Step Over: Run your bot one line at a time, waiting for your input to continue to the next one.
The Actions pane will be replaced with the Watched Variables pane, where you can hide specific variables using the menu for each, or using the checkmark to edit all of them at once. Beyond stepping over and out of your breakpoints, you can still access the search tool while debugging to find specific actions/variable references within your code. Once your bot execution is complete, you can go back to Edit mode by clicking on Exit Debug at the top-right of the Workbench or by pressing “F10” on your keyboard to toggle off debug mode.
Conclusion - Why use Debug mode at all?
While developing you can use breakpoints to pause your bot at any time during the execution, making it easier to test without the need for Message Boxes (not to mention the worry of forgetting to remove all Message Boxes before sending the bot to Production!). Try it on bots that are both simple (linear logic) or complex (containing loops and conditional statements). You’ll soon find that investigating bot issues and resolving problems can be as easy as turning on breakpoints, getting into debug mode, and stepping through your logic.