Activities
latest
false
Banner background image
UI Automation Activities
Last updated Apr 26, 2024

Automated Run of a Local Application

The example below explains how to automate the running flow of a local application by opening it, running it, and then closing it. It presents activities such as Set Text, Type Secure Text, Type Into, Click, Attach Window, Hide Window, Show Window, Minimize Window, Restore Window, or Close Window. You can find these activities in the UiPath.UIAutomation.Activities package.

This is how the automation process can be built:

  1. Open Studio and create a new Process.
  2. Download the archive with the project in this example and copy the folder Apps to your project folder. Double-click the file UIDemo.exe from the Apps folder.
  3. Drag a Sequence container in the Workflow Designer.

    • Create the following variables:

      Variable Name

      Variable Type

      Default Value

      Password

      String

       

      Username

      String

       

      CashIn

      String

      "100"

      UiDemoWindow

      UiPath.Core.Window

       
         
  4. Drag an Assign activity inside the Sequence container.

    • Add the variable Username in the To field.
    • Add the value "admin" in the Value field.
  5. Drag an Assign activity below the Assign activity.

    • Add the variable Password in the To field.
    • Add the value "password" in the Value field.
  6. Drag an Open Application activity below the Assign activity.

    • Inside the activity, click Indicate window on screen, and then select the UIDemo login dialog. The GIF below shows all the steps you need to follow:



  7. Drag a Set Text activity inside the Open Application activity.

    • In the Properties panel, add the variable Username in the Text field.
    • Inside the activity, click Indicate element inside window, and then select the Username field in the login dialog. The GIF below shows all the steps you need to follow:



  8. Drag another Set Text activity below the Set Value activity.

    • In the Properties panel, add the variable Password in the Text field.
    • Inside the activity, click Indicate element inside window, and then select the Password field in the login dialog. The GIF below shows all the steps you need to follow:



  9. Drag a Click activity below the Set Text activity.

    • In the Properties panel, select the check box for the SimulateClick option.
    • Inside the activity, click Indicate element inside window, and then select the Log In button in the login dialog. The GIF below shows all the steps you need to follow:



  10. Run the process to log in to UIDemo.
  11. Drag a Set Text activity below the Open Application activity.

    • In the Properties panel, add the variable CashIn in the Text field.
    • Inside the activity, click Indicate on screen, and then select the Cash In field in UIDemo.
  12. Drag an Attach Window activity below the Set Text activity.

    • In the Properties panel, add the variable UiDemoWindow in the ApplicationWindow field.
    • Inside the activity, click Indicate window on screen, and then select the UiDemo app. The GIF below shows all the steps you need to follow:



  13. Select the Do container from inside the Attach Window activity and create the following variable:

    Variable Name

    Variable Type

    Default Value

    OnUsCheck

    String

    "50"

  14. Drag a Message Box activity inside the Do container of the Attach Window activity.

    Add the expression "Cash In is set to: "+CashIn in the Text field.
  15. Drag a Hide Window activity below the Message Box activity.
  16. Drag a Type Into activity below the Hide Window activity.

    • In the Properties panel, add the variable OnUsCheck in the Text field.
    • Select the check box for the SimulateType option. This simulates, in the background, the type by using the technology of the target application.
    • Inside the activity, click Indicate element inside window, and then select the On Us Check field in UIDemo. The GIF below shows all the steps you need to follow:



  17. Drag a Message Box activity below the Type Into activity.

    • Add the expression "Window is now hidden." in the Text field.
  18. Drag a Show Window activity below the Message Box activity.
  19. Drag a Message Box activity below the Show Window activity.

    • Add the expression "The same window is shown, Cash In is still set to "+ CashIn + vbCr+"On Us Check value was typed while the window was hidden." in the Text field.
  20. Drag a Minimize Window activity below the Message Box activity.
  21. Drag a Message Box activity below the Minimize Window activity.

    • Add the expression "Window is now minimized." in the Text field.
  22. Drag a Restore Window activity below the Message Box activity.
  23. Drag a Message Box activity below the Restore Window activity.

    • Add the expression "Window is now restored. Robot clicks Accept and then closes the window." in the Text field.
  24. Drag a Click activity below the Message Box activity.

    • In the Properties panel, select the check box for the SimulateClick option. This simulates, in the background, the type by using the technology of the target application.
    • Inside the activity, click Indicate element inside window, and then select the Accept button in UIDemo. The GIF below shows all the steps you need to follow:



  25. Drag a Close Window activity below the Attach Window activity.

    • In the Properties panel, add the variable UiDemoWindow in the UseWindow field.
  26. Drag a Message Box activity below the Close Window activity.

    • Add the expression "Window is now closed." in the Text field.
  27. Run the process. The application is opened, run automatically and then closed.

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.