...
  • May 21, 2022
  • Rohit Kashyap
  • 0

Debugging Techniques in UiPath

UiPath Studio offers debugging to identify and rectify errors in the project. It helps you to locate an error, analyze it and apply corrections to support fluent project execution. For an error free project, you must perform debugging at the designing stage.

Different options for debugging are available in the Debug menu:

debug menu
  • Step Into is used to debug activities one by one in a sequential manner.
  • Step Over is used to skip containers such as Sequences, Flowcharts, Invoke Workflow File activities without going into their sub parts and debugs the next activity. You can use this to skip large container flows which are error free to save time and debug faster.
  • Step Out can be seen as an opposite to Step Into. It is used to step out of the current container in the flow. It will complete the execution of activities in that container. Remember it will not skip the part, rather execute it and then go to the next activity.
  • Retry will execute the activity again. The exception is re-produced if any.
  • Ignore is used to ignore any exception that has been encountered and move on to the next activity so that the rest of the workflow can be debugged.
  • Restart is used to start the debug process from the beginning of the project.
  • Break will allow you to pause the debug process at any moment.
  • Focus helps you return to the activity that caused some error while navigating through the debug process.
  • Slow Step works similar to Step Into but comes with different speeds (1x to 4x) to adjust how faster/slower jumps you need. Instead of pausing your debug, you can simply slow it down.
  • Continue on Exception will continue even after an exception, throw it and exit debugging.
  • Picture in Picture allows you to have your process run in a separate session.
  • Remote Debugging enables you to run and debug processes on robots deployed to remote machines.
  • Open Logs will open the log folder located in your localappdata for viewing UiPath logs.
  • Highlight Elements will highlight the UI elements during debugging.
  • Execution Trail shows the entire execution path. Activities which are executed successfully are marked with a green tick, the ones in progress are marked with a yellow timer icon and those which threw an exception are highlighted as red.
Execution trail

Log Activities will provide you a detailed description of each step in the Output window. When enabled, verbose level logs are sent to the orchestrator instead of trace.

log activities

The DEBUG tab

There are four options which let you decide the mode of execution. Select the desired mode from drop the down arrow.

the debug tab

Debug File

Use keyboard shortcut F6 to debug the current file you have selected. Execution takes place in steps and only for the selected design.

Run File

Use keyboard shortcut Ctrl+F6 to run the current file you have selected. Execution takes place in one go and only for the selected design.

Debug

Use keyboard shortcut F5 to debug the entire project. Execution takes place step by step.

Run

Use keyboard shortcut Ctrl+F5 to run the entire project. Execution takes place in one go.

Below is an example where a validation error has been encountered and displayed while performing a debug: –

run
  • Using Test Activity

The test activity feature can be used to debug/execute a particular activity by providing all the required inputs and accessing the output. Right click on the activity in your sequence and click on Test Activity. The following side window will appear with your input variables. Once all the input is provided, click on Continue on the top to carry on execution and check the results.

Using test activity
There are two options related to test activity: –
  • Run from this Activity

This action will execute your process from the selected activity. It allows you to directly make changes to any variables and arguments in the left pane.

  • Run to this Activity

This action will execute your process until the selected activity is reached. It displays related information in the left pane.

Run to the activity
  • Studio Panels

Panels in Studio while debugging provide a bigger picture and detailed information about the process.

  1. Locals Panel displays all the properties, variables, exceptions related to the current debugging. The values can be easily modified for a particular activity by clicking on Edit icon next to it.
Locals panel

2. Call Stack Panel shows the description for each activity, including the next activity and parent containers. This section only gets populated when using Step and Break functions to debug the process or in case of an exception or break-point encountered.

Call stack panel

3. Breakpoints Panel allows you to view your set breakpoints while debugging. Setting a break-point helps to pause the debugging at an activity so that its behavior can be monitored. Make use of the Break-point Settings window to add a Condition, Hit Count and Log message during debugging. 

If the provided condition is true during debugging, the execution will break. 

Hit Count defines the number of times your condition can be met before breaking of the execution, meaning execution will take place till the mentioned hit count even if its higher than the true matches of condition.

Breakingpionts panel

4. Watch Panel allows you to watch your expressions and variable values. Click Add Watch to add an item or add it from the Locals Panel by right clicking->Add to Watch.

watch panel

5. Immediate Panel allows you to evaluate variables, arguments and statements. It also keeps a trail of previous evaluations. Type the variable in the Immediate window and press Enter to get the values displayed. To remove an evaluation, select it and press Spacebar. You can copy or clear all your lines in this window too.

Immediate panel

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *