studiox
2021.10
false
UiPath logo, featuring letters U and I in white
OUT OF SUPPORT

StudioX User Guide

Last updated Nov 18, 2024

Tutorial: Working With UI Automation

In this example, we will create an automation for the following tasks:

  1. Copy values from an Excel file.
  2. Paste the values to specific fields in a desktop application.
  3. Copy the transaction number from the desktop application.
  4. Paste the value to a cell in the Excel file.
  5. Click a button in the desktop application to submit the data.
  6. Display a confirmation message that contains the transaction number and the account number retrieved from the application.

We will create a project and start by adding a Use Excel File activity to indicate the Excel file to use. We will then add a Use Application/Browser that will contain the activities that interact with the application. At the end, we will add a Message Box activity to display the confirmation message.

  1. Step 1: Set up the project and download the necessary files.
    1. Create a new blank project using the default settings .
    2. Download and extract the archive with the automation project in this tutorial using the button at the bottom of this page. Copy the file Transaction.xlsx to your project folder, and double-click the file DoubleUI.exe to open the DoubleUI application.
  2. Step 2: Add the Excel file to the project.
    1. In the Activities panel, select the Resources tab, and then double-click Use Excel File. A Use Excel File activity is added to the Designer panel.
    2. In the Use Excel File activity:
      • Click Browse docs image to the right of the Select an Excel file or range field, and then browse to and select the file Transaction.xlsx.
      • In the field Reference as, enter MyExcel.

        You have indicated that you want to work with the file Transaction.xlsx that will be known in your project as MyExcel.

  3. Step 3: Add the application and the activities to perform in it.
    1. In the Activities panel, select the Resources tab, and then drag an Use Application/Browser activity and drop it inside the Use Excel File activity. A Use Application/Browser activity is added to the Designer panel.
    2. In the Use Application/Browser activity, click Indicate Application, and then move the mouse pointer on the DoubleUI application. When the window is highlighted, click anywhere in DoubleUI.

      The Use Application/Browser activity is updated and a screenshot of the window appears inside the activity.

    3. In the Activities panel, select the Resources tab, and then drag a Type Into activity and drop it inside the Use Application/Browser activity. A Type Into activity is added in the Use Application/Browser activity.
    4. In the Type Into activity:
      • Click Indicate target on screen, then move the mouse pointer on the Cash In field in the DoubleUI.exe application and, when it is highlighted, click the field. The text field is identified as the target and the Cash In label next to it is identified as an anchor. Click Confirm in the Selection Options window to save the selection. An image of the target and anchor is displayed in the Type Into activity.

        You have indicated that you want to type into the field Cash In from the DoubleUI.exe application.

      • Click Plus on the right side of the Type this field, and then select MyExcel > Indicate in Excel. In the Excel file, select the B1 cell (the Cash In value) and click Confirm in the UiPath tab of the Excel ribbon. The Type this field displays your selection as [MyExcel] Sheet1!B1.

        You have indicated that you want to copy the Cash In value from the Excel file to the Cash In field in the DoubleUI.exe application.

    5. Repeat steps 3-4 two more times to add Type Into activities to copy the On Us Check and Not On Us Check values from the Excel file (cells B2 and B3 respectively) to the corresponding fields in the DoubleUI application.
    6. In the Activities panel, select the Resources tab, and then drag a Get Text activity and drop it inside the Use Application/Browser activity after the last Type Into activity. A Get Text activity is added in the Use Application/Browser activity.
    7. In the Get Text activity:
      • Click Indicate target on screen, then move the mouse pointer on the Transaction # value in the DoubleUI.exe application and, when it is highlighted, click the value. The Transaction # value is identified as the target and the label next to it is identified as an anchor. Click Confirm in the Selection Options window to save the selection. An image of the target and anchor is displayed in the Get Text activity.
      • Click Plus on the right side of the Save to field, and then select MyExcel > Indicate in Excel. In the Excel file, select the B4 cell (the Transaction # value) and click Confirm in the UiPath tab of the Excel ribbon. The Save to field displays your selection as [MyExcel] Sheet1!B4.

        You have indicated that you want to copy the value for the Transaction # from the DoubleUI.exe application to the B4 cell in Sheet1 of the Excel file.

    8. In the Activities panel, select the Resources tab, and then drag a Click activity and drop it inside the Use Application/Browser activity after the Get Text activity. A Click activity is added in the Use Application/Browser activity.
    9. In the Click activity, click Indicate target on screen, then move the mouse pointer on the Accept button in the DoubleUI.exe application and, when it is highlighted, click the button. The Accept button is identified as the target and the Cancel button is identified as an anchor. Click Confirm in the Selection Options window to save the selection. An image of the target and anchor is displayed in the Click activity.

      You have indicated that you want to click the Accept button from the DoubleUI.exe application.

    10. In the Activities panel, select the Resources tab, and then drag a Get Text activity and drop it inside the Use Application/Browser activity after the Click activity. A Get Text activity is added in the Use Application/Browser activity.
    11. In the Get Text activity:
      • Click Indicate target on screen, then move the mouse pointer on the Account # value in the DoubleUI.exe application and, when it is highlighted, click the value. The Account # value is identified as the target and the label next to it is identified as an anchor. Click Confirm in the Selection Options window to save the selection. An image of the target and anchor is displayed in the Get Text activity.
      • Click Plus docs image on the right side of the Save to field, and then select Save for Later Use. Enter the name Account # for the value, and click OK.

        You have indicated that you want to copy the value for the Account # from the DoubleUI.exe application and you saved the value under the name Account # for use later in your project.



  4. Step 4: Add and configure the Message Box activity.
    1. In the Activities panel, select the Common tab, and then drag a Message Box activity and drop it inside the Use Excel File activity after Use Application/Browser.
    2. In the Message Box activity, click Plus docs image on the right side, and then select Text. The Text Builder window appears.
    3. We want add to display a text similar to: "Transaction # 123 has been processed for account # 456`. To achieve this:
      • Enter the text "Transaction # ".
      • Click Plus on the right side of the window, and then select MyExcel > Indicate in Excel. In the Excel file, select the B4 cell (the Transaction # value) and click Confirm in the UiPath tab of the Excel ribbon. You have added the transaction number value from the Excel file.

        The text should now look like this: "Transaction # MyExcel Sheet1!B4".
      • Enter the text "has been processed for account # ".
      • Click Plus on the right side of the window, and then select MyExcel > Use Saved Value > Account #. You have added the account number value that you saved for later use earlier.

        The text should look like this:



    4. Click Save in the Text Builder.
    5. Click Save in the StudioX ribbon to save the automation, then click Run to execute the automation.

    The values are copied from the Excel file and entered in the DoubleUI application, the Transaction # from the DoubleUI application is copied to the Excel file, and a message box displaying the transaction and account numbers appears at the end.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.