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

Web Browsing

The example below explains how to automate the action of browsing a webpage by highlighting and showing the content of all items from the header menu. It presents activities such as Open Browser, Highlight, and Hover. 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. Open Internet Explorer and navigate to www.uipath.com.
  3. Drag a Sequence container in the Workflow Designer.

    • Create the following variable:

      Variable Name

      Variable Type

      Default Value

      menuItems

      System.Collections.Generic.IEnumerable<UiPath.Core.UiElement>

       
  4. Drag an Open Browser activity inside the Sequence container.

    • Add the browser's path in the Url field, for this example being www.uipath.com.
  5. Drag a Find Children activity inside the Do container of the Open Browser activity.

    • Inside the activity, click the Indicate on screen option. Select the header of the menu like in the following screenshot:



    • In the Properties panel, add the variable menuItems in the Children field.
  6. Drag a For Each activity and place it below the Find Children activity.

    • Add the value item in the ForEach field and the variable menuItems in the Values field.
  7. Select the Body container of the For Each activity and create the following variable:

    Variable Name

    Variable Type

    Default Value

    aanameValue

    String

     
  8. Place a Highlight activity inside the Body container.

    • In the Properties panel, select the option Target from the Target drop-down list.
    • Add the value item in the Element field. This value selects and highlights each option available in the menu.
    • Select the option Coral from the Color drop-down list. This specifies what color to use for the highlight.
  9. Drag a Hover activity below the Highlight activity.

    • In the Properties panel, add the value item in the Element field. This value hovers all options available on the menu.
    • Select the check box for the SendWindowMessages option. When this option is selected, the hover command is executed by sending a specific message to the target application.
  10. Place a Hover activity below the For Each activity.

    • Inside the activity, click the Indicate element inside browser option. Select the header of the menu like in the following GIF:


    • In the Properties panel, select the check box for the SendWindowMessages option. When this option is selected, the hover command is executed by sending a specific message to the target application.
  11. Drag a Close Tab activity below the last Hover activity.

    • Your workflow should look like in the following screenshot:



  12. Run the process. A new Internet Explorer is opened and navigates to the www.uipath.com address, where it highlights and shows the content of all items from the header menu.

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.