This tutorial is a guest post from Wilson Wylie, RPA Developer at R-Path Automation. Wilson posted some great times for the Customer Onboarding Bot Wars challenge, and was kind enough to share some of his creative approaches with the Automation Anywhere developer community.
If you have an idea for a blog post or tutorial that you think would benefit the Automation Anywhere developer community, let us know at email@example.com.
The Cable Co is missing customers from their customer relationship management system. Download the missing customers CSV (found on the challenge page itself), loop through each customer’s details to enter the customer into the web form. Once all customer’s details have been added, the challenge is complete and your results will be displayed. These results are displayed as a measure of time taken to complete the challenge as well as the accuracy of the data entered.
The following are the three different techniques we used to solve this problem with the goal of building the fastest bot possible while maintaining 100% accuracy. With each technique, we were able to reduce the bot run-time.
For most Automation Anywhere developers, the recorder action is the go-to for interacting with websites. It’s easy to use and consistent with simple websites like the one used in the challenge. Our plan was straightforward:
With the recorder, we can easily use a custom xpath to read the href attribute of the download button to get the name of the file that is downloaded. This allows us to make sure we are reading the correct file:
We can use string variables within our custom xpaths to specify which Active Discount Offered radio button to click based on the input data:
Using the recorder actions, we successfully entered all the data in 24.473 seconds:
Not bad, but we can do better.
We will be using the getByXpath function:
We can use string variables within our custom xpaths here as well:
Using the Web Automation actions, we successfully entered all the data in 1.313 seconds! Down 23.16 seconds from the previous method:
This is a very impressive time, but can we build a bot that submits the data in under 1 second?
An important detail of this exercise is that the timer starts when the webpage is loaded. In order to reduce the bot run-time even further, we need to limit the time spent on the actual website. To accomplish this, we will gather all the CSV input data before navigating to the website using the REST Web Services actions. This method will also bypass the need to save/open files on the local drive:
First, we use the REST Web Services: Get method with the website URL to retrieve the HTML body of the webpage:
The HTML is stored in a dictionary variable with the key “Body” which we can write to a string. The CSV link can be extracted from the HTML text using the “Download CSV” text as an anchor point:
Once we have a cleaned-up string that contains only the CSV download link, we use the Get method again to retrieve the data from the CSV:
This exercise was a great way to explore some of the capabilities of Automation Anywhere. We completed the challenge using three different methods, all with a variety of actions and variables. This is a great example of how there are many ways to solve an automation problem – and depending on the situation, you may need to use some combination of them all to solve your real business problems. Although it is not always necessary to build the fastest bot, nor is it always ideal, it is fascinating to find new ways to push the limits of the Automation 360 platform.
RPA Developer at R-Path Automation
Wilson is a fast learner who enjoys solving new problems every day. He has been in the RPA consulting space for close to 3 years helping clients automate repetitive tasks.