Skip to content

Handling Applications Without Recognizable Locators

In certain desktop applications, it can be challenging to access element details due to their inherent nature. In these cases, HuLoop provides several alternative options for interacting with desktop applications:

  1. Image Action Handler Function: Interacts with UI elements using image recognition when traditional locators (e.g., Inspect, UISpy) are not available. This function allows automation to click, type, compare, or detect elements based on screenshots.
  2. AutoIt Script Handler Function: Executes AutoIt scripts to automate Windows-based UI interactions that cannot be handled through standard automation methods. Useful for managing pop-ups, dialogs, and UI elements when locators fail.

Choose the best method based on your application’s behavior.

Image Action Handler Function

The Image Action Handler function interacts with UI elements based on image matching allowing automation to identify and interact with elements using screenshots.

Steps to Configure:

  1. Capture a Screenshot: Take a screenshot of the element you want to interact with and save it on your system (e.g., Insert Function element in an Excel sheet).

scrn-capture-screenshot-image-action-handler

  1. Open your Case in HuLoop and add a step to create a new action.
  2. From the Action drop-down menu, select Run Utility Commands.
  3. Keep the Screen Name and Element Key fields blank.
  4. In the Function drop-down, select IMAGEACTIONHANDLER.
  5. Select an action from the Operation Menu. Choose one of the following:
    • Click – Clicks on the specified element.
    • Wait – Waits for the element to appear.
    • Exists – Checks if the element is present.
    • Type – Enters text in the specified area.
    • Compare – Matches the image with the existing element.
    • Double-click – Performs a double-click action.

Note: Additional options may appear based on the selected action.

  1. In the File field, enter the file path to the saved screenshot.
  2. Click Save.
scrn-desktop-driver-image-action-handler-tabular-view
Tabular View
scrn-desktop-driver-image-action-handler-card-view
Card View

Expected Outcome on Execution:

  • The automation performs the selected action on the UI element using image recognition.
  • For example, if you choose Click, HuLoop will find the matching image and simulate a click on the element (e.g., clicking the “Insert Function” button in an Excel sheet).

Autoit Script Handler Function: autoitscripthandler

The Autoit Script Handler function allows you to run pre-defined AutoIt scripts within your automation workflow. AutoIt is a scripting language used to automate Windows-based tasks, such as handling popups, entering credentials, or interacting with system dialogs.

This function is especially useful when automating interactions with Windows UI elements that cannot be directly controlled through other Element identifiers.

Creating an Automation Script: Before using this function, define your AutoIt script by following these steps:

  • Click the Menu menu-icon available on the top right of the screen and you will get the following options:

Click Menu

scrn-autoit-menu
Menu
  • Expand the Data option and select Manage Automation Scripts:

scrn-autoit-select-menu

  • You will see the Manage Automation Scripts page:
scrn-autoit-manage-automation-script-page
Manage Automation Scripts Page
  • Provide a name for the script, keep the Environment Name as default, and enter Autoit script in the Automation Script text area.
  • Click Save.

Note: The script name you provide here will be used when referencing this Autoit script in automation workflows.

All existing scripts appear on the right side of the Manage Automation Scripts window, where you can edit or delete them by clicking the respective icons.

Usage Example: Uploading a File with a Dynamic Path

Let’s say your automation requires selecting and uploading a file, where the file path is dynamically stored in a pre-defined variable.

Steps to Configure:

  1. Define the AutoIt Script:
    • Go to Data > Manage Automation Scripts and create the script.
    • Assign a name to the script (e.g., File Upload Handler).
    • Enter the AutoIt script for file upload.
    • Click Save.
  1. Configure the Function in Your Automation Workflow:
    • Add a new step at the required index.
    • Select Run Utility Commands from the Action dropdown.
    • Leave the Screen Name and Element Key fields blank.
    • Click on Form, select Functions, and choose AutoIt Script Handler from the dropdown.
    • All scripts defined in Manage Automation Scripts will appear here. Select the appropriate script (e.g., File Upload Handler).
scrn-autoit-file-handler-tabular-view
Tabular View
scrn-autoit-file-handler-card-view
Card View
  1. Passing Arguments to the AutoIt Script

Since the file path is dynamic, we will pass it as an argument.

Note: The file path should be stored in a predefined variable using the Set a Variable command.

  1. In the Automation Workflow, click the icon to add an argument.
  2. Enter the variable storing the file path (e.g., ${FilePath}).
scrn-autoit-file-handler-args-tabular-view
Adding an Argument: Tabular View
scrn-autoit-file-handler-args-card-view
Adding an Argument: Card View
  1. Repeat this step to add multiple arguments if needed.
  2. Click the delete icon to remove an argument if necessary.

The following screenshot shows an example of how the automation workflow is configured for a file upload scenario using the AutoIt Script Handler function:

scrn-autoit-workflow-example

In this example, the AutoIt script retrieves the parameterized value using $CmdLine[1].

scrn-parameterized-autoit-example
Example of a parameterized AutoIt script where the input value is passed as $CmdLine[1]
Outcome on Execution:

  • The AutoIt script executes with the provided argument (file path).
  • The script performs the necessary action, such as selecting and uploading the file.

Back To Top