Skip to content

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