This article and the referenced chrome extension were created by our community author Sumit Kumar. For any support or queries regarding this extension, please reach out to Sumit.
Kindly note that this is not created/supported by Automation Anywhere, but it’s a great example of the creativity and contribution of 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 firstname.lastname@example.org.
What is Bot Assistant Extension ?
It is a browser extension which adds new features to your A360 bot editor/ viewer.
This extension does not need any special permission and is ready to work out of the box.
How To Use?
- You can find it on chrome webstore: A360 Bot Assistant. Click “Add to chrome” button.
- This will show what this extension will access, in this case no special permissions. Click “Add extension”.
- Navigate to A360 bot edit/view (?public/private) page and click extension icon .
- Extension icon can be clicked to toggle bot assistant, ?pin extension or assign shortcut key for quick toggle.
Why does it exist ? It aims to standardize how bots are built using A360 right from code development to review stage without leaving the code viewer/editor.
Bot Assistant helps ensure best practices are being followed for A360 bots by quickly providing an overview of issues in real-time without scrolling through entire bot.
- Allows developers to proactively make changes before review.
- Allows reviewers to quickly get list of issues without going line by line.
What does it offer?
- It offers Intuitive UI design with drag, collapse and expansion for better UX.
- It allows individuals to set their best practices and guidelines.
By default all the checks are enabled with default values, these can be customized by clicking ⚙️ icon on the assistant, or by right clicking extension icon > option.
Best Practices :
- Error Handling ⛔
- Runtime time out ⌚
- Automation priority
- Lines of code per task
- Number of variables per task
Bot Actions :
- Empty Containers (Step, Try, Catch, If, Else, etc.)
- Disabled action
- Command outside Try-Catch ⛔
- Message Box
- Debug breakpoint
- Hardcoded delay
- Code break (Pause task, Stop task)
Bot Variables :
- Non-constant variable with a hardcoded value
- Constant variable with a lowercase letter in the name
- Variable name minimum length
- Input type variable Regex pattern
- Output type variable name Regex pattern
- Input+Output type variable name Regex pattern
- Regular(Not Input + Not Output) type variable name RegEx pattern
Extension in Action - Testing the Quarter Close Challenge Bot
We tested this extension with our Quarter Close Challenge solution bot built during Bot Games Season 2, and it identified 11 observations in 2 categories.
- Best Practices
Here are the settings I have used in the Chrome extension: In the Best practices section, it flagged the ‘Missing Comment Command’: It showed us that we have not used Comments throughout the entire bot.
A simple solution to fix this is to always add Comments to each section of your bot to improve its readability.
In the Actions section, it flagged the following observations:
Command outside Try-Catch block: As we had not added a blanket Try-Catch block for the entire bot, it flagged it to be fixed.
A solution to fix this observation is to wrap the entire bot with a Try-catch block to ensure all failures are handled gracefully.
Debug Point not removed: We had added debug point for testing purposes; however, it was not removed before we checked in the bot.
Always ensure that you remove the debug points once you complete the testing and before you check in the bot.
Disabled Action not removed: While testing a bot, we used a Message box action to validate the results and we disabled it once the testing is completed, however, the disabled action was not removed before checking in the bot.
It is always a best practice to remove the disabled action unless you foresee that it may be required in the subsequent updates, in which case, add a comment section mentioning the reason for retaining the disabled action.
Hardcode delay Found: We used a static delay command and configured a specific timing; however, a better practice is to use ‘Wait’ and keep it dynamic and introduce a delay based on a required condition.
Empty Command: We used a Try catch block in the logic, however, we did not add any steps to log data or capture screenshots in the Catch block.
It is suggested to add a few steps in every Catch block so that the failure can be analyzed, and it need not be re-executed to check the cause of the failure.
With these fixes, we could re-run the validation and found 0 observations now.
RPA Lead Sumit is a RPA Lead at Holcim. He has expertise in working with Automation 360 platform, creating bot framework, code review extension, and has created custom packages for A360 to integrate with Google workspace apps.