• November 2, 2021
  • Rohit Kashyap
  • 0

RPA UiPath Best Practices Guidelines

RPA is a form of business process automation that allows anyone to define a set of instructions for a robot to perform a defined task. UiPath is a RPA tool used for Web automation, PDF automation, Windows desktop automation etc. This tool can be used for redundant tasks.

UiPath tool allows user to draw a workflow within a flow chart editor. This is helpful and hence, it is marketed as “No Coding” solution.

Many companies have started using RPA due to increase in demand.

While we talk and discuss about RPA/UiPath, here are some best practices we should not forget to follow.

There are some key benefits which we get by following the best practices while development: –

Best development practices

We, as developers, should follow a common framework within the organization. It is a responsibility of a solution architect to build and maintain a standard best practices guideline for developers/for an organization. However, we should know the basic and standard best practices for developing automation workflows.

Mentioned below are some of the quite common practices that we can introduce into our workflows:

Variable Naming Convention

Variable should follow the camel Case naming convention and cannot be single word. Also, Variable cannot start with the “var” prefix

        Good Example Bad Example

Examples

Argument Naming Convention:

Argument should follow the Title Case naming convention and cannot be a single word. All argument should start with the “in”,”out”,”io” prefix, which need to be written in lower case.

Argument Naming Convention examples

Empty Catch Block:

Catch block of Try Catch activities should never be in empty state. At least a Log Message activity should be added into the Catch Block.

Empty catch block examples

Empty Workflow:

There should not be empty workflow files, including sequences,flowcharts, state machine.

Empty workflow

Large Idx in selectors:

Shows the selectors that contain an “idx” attribute greater than 2. This attribute is used to distinguish elements with the same selector based on their order in the interface hierarchy. This order can change if the elements you are automating change, so this attribute should be avoided to avoid the selection of wrong elements.

Consider using other attributes in the selector to make it less dependent on the “idx” attribute. Also, reducing indexes can be achieved by adding information about ancestor elements, using relative elements or the “Anchor Base” activity.

Large Idx in selectors

Unreachable Activities:

It is not recommended to have not connected nodes in flowchart or activities that commented out or that not connected to any node in a flow chart. All these kinds of activities should be removed before publishing to the orchestrator.

Unreachable activities

Nested IF Activities:

It is recommended to have 3 or less 3 nested if clauses in file or project. In such conditions always try to use Switch Activity or Flowcharts.

Nested IF Activities

Empty Sequence:

There should be any empty sequences in between the workflow.

Bad example

Unused Variable:

Most of the time while development we create variable just of the testing purpose and at the end of the development, we forget to remove those variables. It always recommended to remove all the unused variable from all the workflows files. To achieve that you can use the below option from the UIPATH Studio.

Unused Variable

Unused Dependencies:

Always remove the packages from the projects which is not being used before published to the orchestrator.

Unused Dependencies

Simulate Click Check:

Whenever any of the activity which has “Simulate Click” property it should be checked. Using “Simulate Click” doesn’t rely on the mouse driver, so it provides a faster way of performing click actions.

Simulate Click Check

Simulate Type Check:

Whenever any of the activity which has “Simulate Type” property it should be checked. Using “Simulate Type” doesn’t rely on the keyboard driver, so it provides a faster way of performing type actions.

Simulate Type Check

Open Application Wrongly User:

It is always recommended to use open browser activity to open any web portal, please don’t user open application scope for browser activities.

Open Application Wrongly User

Container Usage:

Always checks if consecutive activities in your automation are using the same top-level- selector instead of using a container with a single selector. We recommend as a best practice to use scope, such as ‘Open Browser” or “Open Application”. when performing multiple action on the same UI element, as this method is more reliable instead of targeting each activity on the same selector.

Container Usage

ContinueOnErrorTrue:

All the activities which contain ContinieOnError option in property is always uncheck. When this property is set to True, all error that occur during the execution of the activity are ignored, which is why this option should be uncheck.

ContinueOnErrorTrue

Kill Process Activity not allowed:

For killing any of process it is always recommended to use the “Kill Process for Current User” instead of “Kill Process” Activity.

Kill Process Activitynot allowed

Repeated Display Name in Activities:

All the activities in the workflow should have unique name so that they can be easily identifies/modified if required. This is also help while debugging the code. If you face any error in production so can directly check the activity name and directly go the process rectify the error.

Repeated Display Name in Activities

Hotkey Without Selectors:

All the “Send “Hotkey” activity should be inside any container like “Attached Window/Browser” or “Open Application Browser” or should have selector in it.

Hotkey Without Selectors

WaitForReady not set as complete:

Whenever you are using any activity which contains waitforready property it should always be in values as “COMPLETE”.

WaitForReady not set as complete

Empty Else Block:

Whenever you are using “IF” activity always recommended to use at least log message in the else block, please do not leave else block empty.

Empty Else Block

Password printing log Activity:

Always keep your all the password in assets and always use secure string data type for passwords and never ever print your password in log activity.

Password printing log Activity

WildCard and UnderScore not allowed in ‘parentclass’,’class’,’id’ and ‘parentid’:

Always recommended not use wildcards and underscore in ‘parentclass’,’class’,’id’ and ‘parentid’ attributes.

Hard coded digits not allowed in the ‘tablerow’ attributes:

Always recommended to use variables or dynamic values instead of the hard-coded number.

Xaml filename contains spaces:

Always recommended to not use any kind of spaces into the xaml file name.

Xaml filename contains spaces

Leave a Reply

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