Skip to main content
Join the Agentforce Hackathon on Nov. 18-19 to compete for a $20,000 Grand Prize. Sign up now. Terms apply.

Refine MuleSoft RPA Recorder Autogenerated Steps

Learning Objectives

After completing this unit, you’ll be able to:

  • Unit test autogenerated RPA Bot Task automated steps for robustness and flexibility.
  • Decide to keep or modify each part of the autogenerated RPA process implementation.

How MuleSoft RPA Recorder Works with MuleSoft RPA Builder

Recall from MuleSoft RPA Design Documentation that MuleSoft RPA Recorder is a tool that runs on a Windows system. It records user actions, such as keystrokes and mouse clicks, and creates comments in a BPMN design document that it generates. The documentation generated in MuleSoft RPA Recorder autogenerates workflows with implemented action steps and other elements.

MuleSoft RPA Recorder showing autogenerated workflows with implemented action steps and other elements.

After importing your BPMN model, notice that MuleSoft RPA Recorder has autogenerated a fully implemented workflow for each RPA Bot Task in the RPA process. You can view each workflow element and the corresponding screenshots and documentation captured by MuleSoft RPA Recorder. Double-click an individual RPA Bot Task to open the RPA Bot Task’s Workbench Editor view. Inside the Activity Workflow, locate the App Session block and click a workflow element.

Workflow Elements autogenerated for each RPA Bot Task in the RPA process.

Notice the workflow element brings up a wizard. For example, a Keystrokes to App Element element brings up a Keystrokes to App Element wizard.

Selecting the Keystrokes to App Element workflow element opens the Keystrokes to App Element wizard.

The following table describes common elements you find in an autogenerated RPA implementation.

Element/Action Step Description

App Session block

This is the container for steps that are captured by the MuleSoft RPA Recorder. A developer may also add their own instance of an App Session block and record their own actions.

Keystrokes to App element

This is similar to the Keystrokes Actions step but contained within an App Session block. It also contains metadata about the application where the action was performed.

Click App element

The mouse action is stored in this element within an App Session block. It records mouse movements and mouse clicks. It also contains metadata about the application where the action was performed.

Note: Mouse Actions action steps are similar to the Click App element, but don't need to be enclosed in an App Session block. The Mouse Actions action step’s scope can include the entire screen. It also can specify mouse movement relative to a previous element's results.

Transaction block

The Transaction block provides a way for a developer to group action steps into logical collections.

The MuleSoft RPA Recorder records absolute screen coordinates and keystrokes. To make the workflow more robust, these action steps can be replaced with more flexible and dynamic action steps. 

It’s common to replace some or even all of the autogenerated implementation with more robust and specialized workflow elements. However, the output from using a MuleSoft RPA Recorder is still invaluable because it takes the following screenshots.

  • Where the user is interacting with the screen.
  • The order of interactions taken by the user.
  • The values typed by the user, such as URL, usernames, and passwords.
Note

As a best practice, you should not share autogenerated BPMN files from the MuleSoft RPA Recorder. They may include the keystrokes used to enter sensitive information such as passwords. You are able to edit the autogenerated BPMN documentation and delete sensitive data.

Be Aware of Issues When Moving Autogenerated Code to Another Windows System

MuleSoft RPA bots deployed to production may run on another Windows system with different settings. This is an important reason to modify and consolidate the MuleSoft RPA Recorder’s autogenerated workflow elements.

Notice in the following table that the Windows screen resolution and font smoothing settings are different. The RPA bot computer has a lower resolution than the RPA Builder computer so the edges aren’t as rounded.

System RPA Builder Computer RPA Bot Computer

Windows screen resolution

3072x1920


1920x1080

Image search screenshot

RPA Builder Computer resolution

MuleSoft RPA Bot Computer resolution

At a pixel level, the images in the previous table are very different. A high-precision match on the RPA Builder computer may not match on the RPA bot computer. But if you lower the precision on the RPA Builder computer, you may get too many false positives. This is why you often need to adjust the settings in the action steps or replace the action steps entirely with more robust or specialized action steps.

Here is an example of the settings in the Image Search action step that are affected by the different screen resolutions. These settings adjust how images or fonts are matched between two computers.

Image Search action step settings showing adjustments for how images or fonts are matched between two computers.

Determine When to Use Autogenerated Elements 

MuleSoft RPA Recorder does a great job recording steps. However, there are times when you may need to modify or consolidate those steps to make the RPA bot tasks, and ultimately, the entire RPA process implementation more robust.

It’s common to consolidate multiple steps into fewer steps by modifying elements. For instance, the MuleSoft RPA Recorder may record eight Keystrokes to App Elements in an App Session to run a Chrome application in incognito mode. However, you may be able to achieve an equivalent outcome by disabling the entire app session and combining those steps into one Run Program action step.

If the user recording their keystrokes mistypes something, deletes the mistake, and retypes it, all of these actions are captured in a Keystrokes to App Element action step. So the actual keystrokes shouldn’t always be taken literally.

Actions captured in a Keystrokes to App Element action step.

Disable Elements 

To disable an element in an RPA Bot Task implementation, right-click and select Disable. When disabled, the RPA Bot Task ignores the disabled element, similar to how commented code is ignored by the compiler in a programming language like Java, JavaScript, or C#.

Disabling elements in an RPA Bot Task implementation.

Just like commented code in a programming language, you may want to keep the autogenerated MuleSoft RPA Recorder steps for documentation purposes during your development. You can then decide to keep or delete disabled steps after the implementation is ready for production.

Test a Single RPA Bot Task 

In some cases, the MuleSoft RPA Recorder’s autogenerated code may be sufficient for your MuleSoft RPA Bot Task. You should always test the code. MuleSoft RPA Builder allows you to run an isolated test on an individual RPA Bot Task from the task’s workbench. To run an isolated test, click Run from the RPA Bot Task’s workbench menu bar. This runs the task in the background, provides workflow run results, and reports any errors.

Workbench menu bar showing Run button highlighted.

Note

As a best practice, it’s a good idea to run an isolated test on your RPA Bot Task every time you make a change. It’s normal for the test to fail, which is why you often replace the autogenerated code with other action steps. Even if the test succeeds, it's still very common to replace the autogenerated workflow action steps with more robust or specialized action steps.

In this unit, you learned how to decide whether to keep or optimize MuleSoft RPA Recorder autogenerated solutions. You also learned how to isolate and test autogenerated RPA bot tasks to determine whether modifications and optimizations were necessary.

=

Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires