Design a Bot Using Common Automation Activities

This tutorial shows you how to integrate the Common Automation activities with other automation activities set, create process flow that involves multiple applications, and create the bot.

Background

You use the activities available in other automation activities set with the Common Automation activity to create the bot.

Prerequisites

  • Access to ASG Studio Manager.
  • Start the Automation Spy application using ASG-Studio Manager.
  • Check the availability of the following applications on your computer:
    • Notepad
    • Calculator
    • Microsoft Word

Design the Bot

In this section, you design the RPA Model for performing the automation task.

  1. Launch the Notepad application and type the following text: I am doing fine.
    • On the File menu, click Save As, select the %userprofile%\Desktop folder (Desktop folder in the current user profile), enter Notepad in the File name field, and then click Save.
  2. Open Microsoft Word, click File, select New, and then select Blank Document. Do the following:
    • Type the following text: Have a nice day!
    • Save the Word Document as PDF in the %userprofile%\Desktop folder with the name Test.
  3. Launch ASG-Studio.
  4. Create an RPA Model. See Create and Design RPA Model.
    Alternatively, you can open an existing RPA Model. If you are using an existing RPA Model click Clear in the Element Toolbar to remove any activities that have been previously added to the visual designer.
  5. In the visual designer, drag Start Event from the element toolbar and drop it on the visual designer.
    Keep the default activity name.
  6. In the Activities Panel, expand the specified activity group, then drag the following activities and drop them onto the visual designer.
  7. Keep the default display name of the activities.

    To connect the activity shapes, select the first activity shape, click and hold the Sequence Flow or Association arrow icon, drag the arrow to the other shape, and then click the second activity shape.

    Activity Set

    Sub-Folder

    Action Name

    Other Properties

    Connect From

    Connect To

    Common

    Misc Actions

    Error Handling

    • If error occurs?: (Select) Continue Processing
    • Take Screenshot: Toggle the button to Off.

    Start

    Error Handling

    Common

    System Actions

    Set ClipBoard Text

    Enter variable name/text to set clipboard text: Hi, how are you doing?

    Error Handling

    Set ClipBoard Text

    Common

    System Actions

    Get ClipBoard Text

    Enter variable name to assign clipboard text: GetCT

    Set ClipBoard Text

    Get ClipBoard Text

    Desktop Automation

    Generic Actions

    Open Application

    Application Name/Path: notepad

    Get ClipBoard Text

    Open Application

    Common

    Windows Actions

    Set Window State

    • Window name: Untitled - Notepad
    • Choose State: (Select) Maximize

    Open Application

    Set Window State

    Common

    Misc Actions

    Set Text

    Enter text to send: GetCT

    Set Window State

    Set Text

    Common

    Window Actions

    Wait For Window To Exist

    • Window name: Notepad
    • Maximum how many seconds to wait: 180

    Set Text

    Wait For Window To Exist

    Desktop Automation

    Keyboard Actions

    Send Keystrokes

    • Key (Control [Control]), Action (Key Down)
    • Key (A [A]), Action (Key Press (Down + Up)
    • Key (C [C]), Action (Key Press (Down + Up)
    • Key (Control [Control]), Action (Key Up)

    Wait For Window To Exist

    Send Keystrokes

    Common

    Window Actions

    Activate Window

    Enter Window Name to Active: Untitled - Notepad

    Send Keystrokes

    Activate Window

    Desktop Automation

    Keyboard Actions

    Send Keystrokes

    • Key (Control [Control]), Action (Key Down)
    • Key (V [V]), Action (Key Press (Down + Up)
    • Key (Control [Control]), Action (Key Up)

    Activate Window

    Send Keystrokes

    Desktop Automation

    Generic Actions

    Open Application

    Application Name/Path: calc

    Send Keystrokes

    Open Application

    Desktop Automation

    Generic Actions

    Window Element Action

    • Choose Action: (Select) Click Element
    • Action (Left Click), Key (AutomationID), Value (num9Button)
    • Action (Left Click), Key (AutomationID), Value (num9Button)
    • Action (Left Click), Key (Name), Value (Plus)
    • Action (Left Click), Key (AutomationID), Value (num1Button)
    • Action (Left Click), Key (Name), Value (Equals)

    Open Application

    Window Element Action

    Desktop Automation

    Generic Actions

    Window Element Action

    Choose Action: (Select) Get Value From Element

    Get From: (AutomationId) CalculatorResults

    Assign To: (Assign To) result

    Window Element Action

    Window Element Action

    Common

    Window Actions

    Activate Window

    Enter Window Name to Active: Untitled - Notepad

    Window Element Action

    Activate Window

    Common

    Misc Actions

    Set Text

    Enter text to send: result

    Activate Window

    Set Text

    Common

    Misc Actions

    Modify Variable

    • Enter Variable Name: GetCT
    • Enter Input to be Set to above Variable: Thanks.

    Set Text

    Modify Variable

    Common

    Misc Actions

    Set Text

    Enter text to send: GetCT

    Modify Variable

    Set Text

    Common

    Misc Actions

    PDF Extraction

    PDF File Path: C:\Users\%userprofile%\Desktop\Test.pdf

    Variable name: pdfextract

    Set Text

    PDF Extraction

    Common

    Window Actions

    Activate Window

    Enter Window Name to Active: Untitled - Notepad

    PDF Extraction

    Activate Window

    Common

    Misc Actions

    Set Text

    Enter text to send: pdfextract

    Activate Window

    Set Text

  8. Drag End Event from the Element Toolbar and drop it on the visual designer. Keep the default activity name.

    Connect Set Text to End Event.

  9. In the Element Toolbar of the visual designer, click Run to execute the RPA Model.
    • A message is displayed in the visual designer after successful completion of the RPA Model execution.

When the bot is running, notice that the notepad file is launched, and the specified text is copy and then pasted from the clipboard, Notepad.txt, Calculator application, and Test.pdf. After the text is added from the clipboard, open the Notepad.txt you have created in the %userprofile%\Desktop folder, to make the specified file window active. The text is copied from the Notepad.txt file to the untitled notepad. If you don’t open the notepad file, the process flow execution will move to the next step as Continue Processing is selected for error handling.

Check the following text in the untitled notepad file: Hi, how are you doing? I am doing fine. Display is 100 Thanks. Have a nice day!!