Skip to main content

Prerequisites

You’ll need to have Automation Anywhere Enterprise v11 workbench installed and licensed with a bot creator license to follow along with this lab.

Background

This lab is the same back story as our last. Review the details below to re-familiarize yourself with the scenario. Most all web applications have some sort of login process. The primary focus of this first bot is to enter a username and password into a log in form, and successfully log in to a web application.

Pseudocode

Think of pseudocode as the human readable steps that our program/bot will need to accomplish. When creating a bot, it can be helpful to lay out the steps that the bot will need to take to accomplish a task. In this way, the process of translating into Automation Anywhere commands becomes more straightforward, and we can know we did everything needed.

Step 1: Launch Website – We'll have to have the website open to start entering any username/password info.

Step 2: Enter Email Address – The email address is a required field, and will be needed for us to properly log in.

Step 3: Enter Password – The password will need to be entered into the password field, and the password will have to be correct in order for our login to work.

Step 4: Click the Sign In Button – Just like as if a human were logging into this page manually, our bot will have to click the Sign In button in order to initiate the login process.

Building The Bot

With our requirements clearly defined, we can now move on to building our bot. In the last tutorial, we used the web recorder to automatically create the commands for our bot to properly execute. In this lab, we'll be using the Automation Anywhere Workbench to add all of those commands manually.

  1. Launch and login to the Automation Anywhere Client (Either Enterprise or Community - either will work).
  2. In the upper left corner of the screen, click the "New" button.
  3. An "Automate" dialogue will appear asking how you want to get started. Press the green Workbench button to continue.
  4. A blank Workbench session will open. Quickly note the layout:
    1. Along the top of the workbench, you'll notice a New button to create new tasks or subtasks, a Record button to create a new task using the recorder, a Run button which we used to execute our bot, and a Save button to save our bot. There are also two buttons for Debugging options which allow you to create breakpoints to step through your code (beyond the scope of this tutorial).
    2. In the middle of the screen (at this point all white and completely blank) is the action list. As we start to add different commands for our bot to execute, those commands will all be listed out (in order) on the actions list.
    3. Along the left-hand side of workbench are 2 tabs which are used to actually build our bots.
      1. Commands Tab – this tab has all of the commands that are used for building bots. Everything from launching applications web scraping, excel reading/writing, and string manipulation. Notice that some of the commands have a + next to them. That means that these commands contain sub commands which further specify how the commands can be used. We'll use some of these in later tutorials
      2. Metabots Tab – a metabot is a reusable component which you can use in many different bots. Metabots can either be based on task automation or can be based on imported dynamic-link libraries (DLLs) which are written in .NET.                                                                                                                                
    4. On the right-hand side of the screen are 3 tabs which appear somewhat hidden at first by default. They are the Errors View, Variable Manager, and Bot Dependencies Tabs
      1. The Errors View tab shows the different error handlers that are being used in the current bot with icons demonstrating what those error handlers are set up to do.
      2. The Variables Manager (the tab you'll most commonly have up) allows developers to create, modify, delete, and view variables. Variables are used to store and reference data that your bot needs to complete its task. We'll use some variables later in this tutorial, so feel free to leave this tab open.
      3. The Bot Dependencies tab is used to help identify the other files in the same Application Directory as the bot you're currently modifying. This will be more important as you start to create bots that call sub-tasks (other bots) as a part of their processing.                                                                                                      
  5. The first thing we need our bot to do is to launch our web browser and navigate to the specific page we're going to be using for our automation. From the commands tab on the left side of the screen, click and drag the Open Program/File command over on to the Actions List.
  6. As soon as you drag this Open Program/File command over, notice that it pops-up with a context menu asking for a couple parameters.
    1. The Step 1 field is the Program/File Path. Press the browse button next to this field to open up a windows browser window. Here, you'll give the specific instruction to open a particular application. In the case of this tutorial, we want to select the Google Chrome executable file. For me, that's located in C:Program Files (x86)GoogleChromeApplication. Your path is likely very similar if not the same. In that folder, select the chrome.exe executable and press the Open button to close the dialog.
    2. The Step 3 field is the other field we're concerned with in this command. In step 3 we give a parameter to be used with the application selected in Step 1. For us, that parameter will be the URL of our tutorial page: https://www.automationanywhere.com/automationanywherelabs/login.html
  7. Press the Save button to close the Open Program File Command.
  8. You should now see your first command showing up in the Actions list in the middle of the screen.
  9. Press the Save button with the disk icon at the top of the screen to save this new bot.
  10. When prompted, give the name MyFirstBot_Chrome.atmx - which will save to the default My Tasks directory
  11. Once the bot has been saved, press the Play button to launch the bot.
  12. In the bottom right corner of your screen, you should see a dialog window appear which shows the progress of your bots execution. In our case, out bot only has 1 line, so that window will pop up quickly and close as the bot has finished its execution.
  13. As the bot runs, you should see that Google Chrome opens up and automatically navigates to the page we provided in the Open Program/File command.
  14. Leave this window open as we'll use it for the next commands which we'll be adding.
  15. In the Commands tab on the left side of the workbench, click and drag the Object Cloning command into the Action List.
  16. The Object Cloning window will appear. If you click into the dropdown list at the top, you'll notice that its displaying the title for EVERY window you have open on your computer. From this dropdown, select the window titled Automation Anywhere Labs - Login - Google Chrome.
    1. If you don't see this window title, make sure that the window which launched as a result of step 13 is still open. If its open, but opened as a tab behind another browser, click and drag the tab off of the browser so that our target browser session is open in its own chrome window.
  17. Object Cloning is SUPER powerful, but can be tricky to understand at first, so read this next section carefully. With the appropriate window already selected in the dropdown at the top, click and hold the Capture button.
  18. With the Capture button still held down, you'll notice that Automation Anywhere automatically switches your screen over to the browser window we selected in the Object Cloning Configuration window.
  19. While still holding the left-mouse click down (we haven't let go of it since step 17), highlight over the Email Address input field from our login lab.
  20. With your mouse held over the email address field (and the left click still held down), a red box should start to flash up on the screen where the email address field is. This is the Automation Anywhere Chrome Extension identifying the object on the page you wish to interact with. Once you see that highlighted red box showing up on the expected field, release the left-click.
  21. The Automation Anywhere Workbench should automatically re-gain the focus of your screen and the Object Cloning Configuration window should have some details filled in that weren't there previously.
  22. If you look at the Object Details, you'll see everything that Automation Anywhere identified as relevant for finding that object (the Email Address Input field) on the page.
  23. On the right hand side of the Object Cloning Configuration window is a drop down where we can select the action we want to perform with the object in question. Choose the Set Text item from the drop down list and enter the following email address in the Text to Set field: user@automationanywhere.com
  24. Press Save to commit your changes.
  25. We'll need to do the same thing for the password field. Start by dragging the Object Cloning command from the commands pane and drag it onto the Actions List.
  26. Repeat steps 16-21 for the password field. When prompted, the Text to Set for the password field should be set to Automation123 (Note: Capitalization DOES matter, so make sue Automation123 starts with an Upper Case A).
  27. At this point you should have 3 total lines in your action list.
    1. Line 1: Open Google Chrome and Launch our Labs Website
    2. Line 2: Object Cloning and entering the username
    3. Line 3: Object Cloning and entering the password
  28. The last thing we'll need to do is to perform a button click on our website to submit our login credentials. To do that, we'll use one more Object Clone command to click the Sign In button.
  29. Click and drag an Object Cloning command on to your Actions List. When prompted, once again select the Automation Anywhere Labs – Login – Google Chrome window from the dropdown.
  30. Like we did with the two input fields, click the Capture button on the Object Cloning Configuration window. When the Login page appears in Chrome, place the cursor over the Sign In button until a red border starts blinking around it – at which point you may release the held click.
  31. Click the Select Action to Perform dropdown and select the Left Click option.
  32. Press the Save button to close the Object Cloning window for the button click.
  33. Finally, press ctrl+s or the Save button along the top of the workbench window to save your work.

Run Your Bot

With the development done, it's time to run your newly created bot. Before you start, make sure you close the Google Chrome browser window you used previously in this tutorial. Your bot should be opening a new browser session automatically upon execution.

  1. In our last lab, we launched the bot from the Enterprise Client. In this lab, we'll launch the bot directly from the Workbench.
  2. With all of your work saved (Save again if you need to), and your MyFirstBot_Chrome.atmx still open in the workbench, click the green Play button at the top of the screen
    1. Note: If you haven't saved your work the Play button will be grayed out, so make sure that you have saved before trying to click Play.

  1. Click the green Play button and let go of your mouse.


At this point the bot should automatically launch Google Chrome, enter the email address, enter the password, and press the Sign In button. Upon successful submission of the username and password above, the web login page should display a modal that indicates task completion.

If your login page did not display this message, check to make sure the username and password that you entered during the web configuration of the Object Cloning was correct. If your Total Processing Time value is 0.00, don't worry – it just means that from the time between when your bot entered the email address to when it pressed the Sign In button was less than one hundredth of a second. If your processing time is higher than 0.00, that's fine too…its still likely significantly faster than how quickly a human could enter this data.

Recap

Now you are on your way to becoming an expert bot builder. Our first lab was all web recorder - the easy way to record steps using Internet Explorer. In this lab, we did things manually in Google Chrome so we could understand exactly how each step impacted our automation. This knowledge is extremely helpful to know so that when things need to be updated (maybe a target application changes, or we want the bot to perform additional tasks) – you can know exactly where to go to fix things.

Next Steps

With the foundation of a Web Recorder based bot and an Object Cloning based bot behind us – its time you can think about building more complex automations integrating bots from Bot Store into our own bot to enhance our bot building capabilities.

Be the first to reply!

Reply