Activities
latest
false
Banner background image
UI Automation Activities
Last updated Mar 18, 2024

Find and Manipulate Window Elements

The example below explains how to automate the action of changing the font size in a notepad file. It presents activities such as Find Element, Find Relative Element, Click, Activate, or Set Focus. 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. Drag a Sequence container in the Workflow Designer.

    • Create the following variable:

      Variable Name

      Variable Type

      Default Value

      EditElement

      UiPath.Core.UiElement

       

      FormatElement

      UiPath.Core.UiElement

       
  3. Drag an OpenApplication activity inside the Sequence container.

    • Inside the activity, click the Indicate window on screen option. Then you can select the Notepad window. The GIF below shows all the steps you need to follow:



  4. Drag a Find Element activity below the OpenApplication activity.

    • Inside the activity, click the Indicate on screen option. The GIF below shows all the steps you need to follow:


    • In the Properties panel, select the COMPLETE option from the WaitForReady drop-down list.
    • Add the variable EditElement in the FoundElement field.
  5. Place a Find Relative activity below the Find Element activity.

    • In the Properties panel, add the value 20 in the OffsetX field.
    • Select the option TopRight from the Position drop-down list.
    • Add the variable EditElement in the Element field.
    • Add the variable FormatElement in the RelativeElement field.
  6. Place a Click activity below the Find Relative activity.

    • In the Properties panel, add the variable FormatElement in the Element field.
    • Select the None option from the KeyModifiers drop-down list.
  7. Place another Click activity below the first Click activity.

    • Inside the activity, click the Indicate on screen option. The GIF below shows all the steps you need to follow:


  8. Drag an Activate activity below the Click activity.

    • Inside the activity, click the Indicate on screen option. The GIF below shows all the steps you need to follow:


  9. Place a Set Focus activity below the Activate activity.

    • Inside the activity, click the Indicate on screen option, and select the Size menu option. The GIF below shows all the steps you need to follow:


  10. Drag a Send Hotkey activity below the Set Focus activity.

    • In the Key field, type the value down.
    • In the Properties panel, select the check box for the Activate option. This option brings the UI element to the foreground and activates it before the text is written.
    • Select the None option from the KeyModifiers drop-down list.
    • Select the check box for the SpecialKey option. This indicates that you are using a special key in the keyboard shortcut.
  11. Place a Click activity below the Send Hotkey activity.

    • Inside the activity, click the Indicate on screen option. The GIF below shows all the steps you need to follow:


  12. Run the process. The automation opens a new Notepad file, navigates through the menu and changes the font size.

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.