Windows Automation Module

Developers can use the Windows Automation module's low-code methods to interact with user interface elements of a resource running Windows. The methods allow native interactions with Windows user interfaces, using properties such as automation IDs, control types, and names.

This page describes how to integrate Windows-specific methods into your robotic process using Appian RPA's low-code Windows Automation module, which provides an easier and more robust development experience.

For more experienced developers, more options are available using the Java module.

The Windows Automation module can only be used in robotic processes that execute on resources running Windows.

About Windows automation

Microsoft UI Automation is an accessibility framework for Windows applications. It is typically applied to assistive technologies, such as screen readers, but it can be used in Appian RPA to detect the attributes of elements on a screen and then act on them.

Microsoft's documentation for UI Automation describes the framework's capabilities in depth. Visit Microsoft UI Automation to learn more.

To help make your development experience faster and more reliable, you may want to use an accessibility development tool such as Accessibility Insights to capture the properties that identify user interface elements.

Using the Windows Automation module

When you build the robotic process workflow, you'll see the following methods available in the Windows Automation module:

Close application

This method closes the application you specify. You can close the currently active application, or choose one by name.

You can configure CONFIGURATION and AFTER COMPLETION parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Close active application: Choose this option to close the active application on the resource.
  • Close application by process name: Choose this to close an application by entering its name.
    • Process name: Enter the name of the application to close, using its process name. For example: notepad.exe. This field lets you enter a text string, choose a variable, or use the expression editor.
  • Fail if application is not found: Check this box if you want this action to fail if unable to find the application specified.

After completion

In the AFTER COMPLETION area of the method pane, configure the following parameters:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Get attribute

This method captures the attribute of a specified element on the screen.

You can configure CONFIGURATION, OUTPUT, and AFTER COMPLETION parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Element selector: Choose how to identify the element where you want to capture the attribute: Name, Automation ID, Class name, or Advanced.
    • Name: Identify the element using a name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, Text, and Window.
      • Name: Enter the name of the element where you want to capture the attribute.
    • Automation ID: Identify the element using an Automation ID.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, Text, and Window.
      • Automation ID: Enter the automation ID of the element where you want to capture the attribute. Learn how to use the AutomationID property.
    • Class name: Identify the element using a class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, Text, and Window.
      • Class name: Enter the class name of the element where you want to capture the attribute.
    • Advanced: Identify the element using a combination of Control type, Name, Automation ID, and Class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, Text, and Window.
      • Configure the Name, Automation ID, and Class name fields as described above.
    • Specify index: Enter a value to identify an element by its index on the screen. The index can be helpful when more than one element has been found with the specified criteria and you want the one at the specified index. The index is 0-based. This field lets you enter a number, choose a variable, or use the expression editor.
  • Attribute: Choose which attribute to capture. Options include Text, Value, Name, Automation ID, Class name, Clickable point, Control type, Description, Enabled, Is expanded?, Is modal?, Is password?, Is selected?, Is status?, Is offscreen?, Process ID, Provider description, Read only, State, and Title.
  • Fail if…: Determines the condition under which the action should fail. Available options are:
    • Element not found: After the configured wait time, the element still does not exist on the screen. Use this if the element must be found to continue with the process.
    • More than one element is found: Multiple elements on the page matched the selection criteria as defined in Element selector. Use this if you only expected to find one element.
  • Wait time: Lets you specify the maximum amount of time the robotic process should wait for the element before moving on. If the element is found before the defined time, it will continue as soon as the element is found. Choose from these options:
    • Use default max wait time: When selected, the robotic process waits for the default wait time of 30 seconds. If this time elapses without finding the element, the action completes.
    • Enter max wait time: When selected, you can enter the maximum time (in seconds) the robotic process should wait. This number must be greater than zero. If this time elapses without finding the element, the action completes.
    • Don't wait: If the element isn't found, the action completes without waiting.

Output

This method returns different types depending on the chosen Attribute:

Attribute Returns
Text String
Value String
Name String
Automation ID String
Class name String
Clickable point Point
Control type Integer
Description String
Enabled Boolean
Is expanded? Boolean
Is modal? Boolean
Is password? Boolean
Is selected? Boolean
Is status? String
Is offscreen? Boolean
Process ID Integer
Provider description String
Read only Boolean
State String
Title String

In the OUTPUT area of the method pane, configure the following parameters to store this result:

  • Operator: Select an option to store the result as a single-value variable (is stored as) or add the result as a multiple-value variable (is appended to).
  • Target: Enter the name of the robotic process variable where you want to store or append the result. If your process variable is type CDT, you can specify which field of a CDT to store the result into using dot notation.

After completion

In the AFTER COMPLETION area of the method pane, configure the following parameters:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Interact with element

This method lets you interact with elements on the screen, based on the selection and configurations you specify.

You can configure CONFIGURATION and AFTER COMPLETION parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Element selector: Choose how to identify the element to interact with: Name, Automation ID, Class name, or Advanced.
    • Name: Identify the element using a name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, and Window.
      • Name: Enter the name of the element to interact with.
    • Automation ID: Identify the element using an Automation ID.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, and Window.
      • Automation ID: Enter the automation ID of the element to interact with. Learn how to use the AutomationID property.
    • Class name: Identify the element using a class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, and Window.
      • Class name: Enter the class name of the element to interact with.
    • Advanced: Identify the element using a combination of Control type, Name, Automation ID, and Class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Button, CheckBox, ComboBox, Edit, MenuItem, RadioButton, and Window.
      • Configure the Name, Automation ID, and Class name fields as described above.
    • Specify index: Enter a value to identify an element by its index on the screen. The index can be helpful when more than one element has been found with the specified criteria and you want the one at the specified index. The index is 0-based. This field lets you enter a number, choose a variable, or use the expression editor.
  • Fail if…: Determines the condition under which the action should fail. Available options are:
    • Element not found: After the configured wait time, the element still does not exist on the screen. Use this if the element must be found to continue with the process.
    • More than one element is found: Multiple elements on the page matched the selection criteria as defined in Element selector. Use this if you only expected to find one element.
  • Wait time: Lets you specify the maximum amount of time the robotic process should wait for the element before moving on. If the element is found before the defined time, it will continue as soon as the element is found. Choose from these options:
    • Use default max wait time: When selected, the robotic process waits for the default wait time of 30 seconds. If this time elapses without finding the element, the action completes.
    • Enter max wait time: When selected, you can enter the maximum time (in seconds) the robotic process should wait. This number must be greater than zero. If this time elapses without finding the element, the action completes.
    • Don't wait: If the element isn't found, the action completes without waiting.
  • Interaction: Select the interaction to perform. The options change based on the Control type you select:

    Control type Interaction options
    Button Click, Focus
    CheckBox Focus, Toggle
    ComboBox Collapse, Expand, Focus, Set value. If using Set value, you can enter text, choose a variable, or use the expression editor in the Value field.
    Edit Set value, Update value with username, Update value with password. If using Set value, you can enter text, choose a variable, or use the expression editor in the Value field. See below for instructions on using usernames and passwords.
    MenuItem Click, Collapse, Expand. Use the Expand and Collapse interactions to open or close expandable menus. For example, use these interactions with the Start menu. Use the Click interaction on MenuItems that aren't expandable, such as distinct options in the menu.
    RadioButton Select, Add to selection, Remove from selection
    Window Close, Focus, Maximize, Minimize, Restore down

    When you select Edit as the Control type, you can update the element's value with a username or password. This configuration uses Appian RPA's credential feature to securely input this information.

    • Update value with username: Select a username associated with a credential entry. To start, choose the selection method for the credential:
      • Selection method: Choose whether to use any available credential for an application, or a specific credential entry. Additional options appear based on your selection.
        • Any available credential: When selected, a Select application dropdown menu appears for you to select the application to use. The robotic process uses any available credential's username for the selected application.
        • Specific credential: When selected, a Select credential dropdown menu appears for you to select a credential entry to use. Each entry shows the credential's application name and username. The robotic process will use the username associated with the credential.
    • Update value with password: Select a password associated with a credential entry. To start, choose the selection method for the credential:
      • Selection method: Choose whether to use a password associated with a previously referenced credential, or a specific credential entry. Additional options appear based on your selection.
        • Previously referenced credential: When selected, a Select application dropdown menu appears for you to select the application associated with a credential referenced previously in the robot's workflow. The robotic process uses the password associated the selected application and previously referenced credential. Note that the robotic process execution will fail if it attempts to use a password based on a previously referenced credential and no credential was added earlier in the process. First input the username, and then use this option to input the related password.
        • Specific credential: When selected, a Select credential dropdown menu appears for you to select a credential entry to use. Each entry shows the credential's application name and username. The robotic process will use the password associated with the credential.

After completion

In the AFTER COMPLETION area of the method pane, configure the following parameters:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Is element present

This method enables the robotic process to determine if an element is present on the screen during execution. Specifically, this method doesn't wait to locate the element.

You can configure CONFIGURATION, OUTPUT, and AFTER COMPLETION parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Element selector: Choose how to identify the element: Name, Automation ID, Class name, or Advanced.
    • Name: Identify the element using a name.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Name: Enter the name of the element to identify on the screen.
    • Automation ID: Identify the element using an Automation ID.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Automation ID: Enter the automation ID of the element to interact with. Learn how to use the AutomationID property.
    • Class name: Identify the element using a class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Class name: Enter the class name of the element to identify on the screen.
    • Advanced: Identify the element using a combination of Control type, Name, Automation ID, and Class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Configure the Name, Automation ID, and Class name fields as described above.
    • Specify index: Enter a value to identify an element by its index on the screen. The index can be helpful when more than one element has been found with the specified criteria and you want the one at the specified index. The index is 0-based. This field lets you enter a number, choose a variable, or use the expression editor.
  • Consider not found when…: Determines the condition under which the action should return false. Available options are:
    • More than one element is found: Multiple elements on the page matched the selection criteria as defined in Element selector. Use this if you only expected to find one element.

Output

This method returns a Boolean. It returns true if the element is present, and false if the element isn't present. It also returns false if more than one element is found and you selected this option under Consider not found when….

In the OUTPUT area of the method pane, configure the following parameters to store this result:

  • Operator: Select an option to store the result as a single-value variable (is stored as) or add the result as a multiple-value variable (is appended to).
  • Target: Enter the name of the robotic process variable where you want to store or append the result. If your process variable is type CDT, you can specify which field of a CDT to store the result into using dot notation.

After completion

In the AFTER COMPLETION area of the method pane, configure the following parameters:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Open application

This method tells the robotic process to open an application. If the application isn't already running, this method starts it. If the application was running, you can choose whether this method should start a new instance of that application. This method's configuration options also let you set the context once the application is open.

You can configure CONFIGURATION and AFTER COMPLETION parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Executable name: Enter the name of the application to open, using its process name. For example: notepad.exe. This field lets you enter a text string, choose a variable, or use the expression editor.
    • Use first found application window: Choose this option if you want to set the context to be the first application window that the robotic process finds.
    • Find by window title: Choose this option if you want to set the context to be a window with a specific title.
      • Expected window title: Enter the window title you want to set as the context. This field lets you enter a text string, choose a variable, or use the expression editor.
  • Attach to a running instance of application: If the application was previously running, select this option to have the method open the application as part of the running instance. If left unselected, the method will open another instance of the application.

After completion

In the AFTER COMPLETION area of the method pane, configure the following parameters:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Set search context

This method lets you change the context for the robotic process. After you set the context, such as a pane or window, subsequent actions take place within that area. Use this method when your robotic process needs to access fields of another open application or within a pop-up window opened by the current application.

About context

Search context is the context within a robot can search for an element. If your search context is set as the Calculator window, then the robot can only find and interact with elements that are within that Calculator window. The methods Open application and Set search context always have a search context of the whole desktop. Therefore, these methods can find any application, window or pane within the desktop. The context for all the other Windows Automation methods is based on the most recent Open application or Set search context method.

For example, if you first open a Notepad application, open a Calculator application next, and then use the Wait for element method, the robot will only be able to wait for elements within the Calculator window. To find and interact with any element or window outside the Calculator window, you must use the Set search context method to define the proper context.

You can configure CONFIGURATION and AFTER COMPLETION parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Element selector: Choose how to identify the element to set as the context: Name, Automation ID, Class name, or Advanced.
    • Name: Identify the element using a name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Pane or Window.
      • Name: Enter the name of the element to set as context.
    • Automation ID: Identify the element using an Automation ID.
      • Control type: Choose the control type of the element to detect on the screen. Options include Pane or Window.
      • Automation ID: Enter the automation ID of the element to set as context. Learn how to use the AutomationID property.
    • Class name: Identify the element using a class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Pane or Window.
      • Class name: Enter the class name of the element to set as context.
    • Advanced: Identify the element using a combination of Control type, Name, Automation ID, and Class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include Pane or Window.
      • Configure the Name, Automation ID, and Class name fields as described above.
    • Specify index: Enter a value to identify an element by its index on the screen. The index can be helpful when more than one element has been found with the specified criteria and you want the one at the specified index. The index is 0-based. This field lets you enter a number, choose a variable, or use the expression editor.
  • Fail if…: Determines the condition under which the action should fail. Available options are:
    • Element not found: After the configured wait time, the element still does not exist on the screen. Use this if the element must be found to continue with the process.
    • More than one element is found: Multiple elements on the page matched the selection criteria as defined in Element selector. Use this if you only expected to find one element.
  • Wait time: Lets you specify the maximum amount of time the robotic process should wait for the element before moving on. If the element is found before the defined time, it will continue as soon as the element is found. Choose from these options:
    • Use default max wait time: When selected, the robotic process waits for the default wait time of 30 seconds. If this time elapses without finding the element, the action completes.
    • Enter max wait time: When selected, you can enter the maximum time (in seconds) the robotic process should wait. This number must be greater than zero. If this time elapses without finding the element, the action completes.
    • Don't wait: If the element isn't found, the action completes without waiting.

After completion

In the AFTER COMPLETION area of the method pane, configure the following parameters:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Wait for element

This method tells the robotic process to wait for an element to appear on the screen. If the element isn't immediately present, the method waits for it to appear, based on the amount of time you configure. You can determine the conditions when this action fails if the element isn't found in the maximum amount of time specified.

You can configure CONFIGURATION and OUTPUT parameters for this method.

Configuration

In the CONFIGURATION area of the method pane, configure the following parameters:

  • Element selector: Choose how to identify the element to wait for: Name, Automation ID, Class name, or Advanced.
    • Name: Identify the element using a name.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Name: Enter the name of the element to wait for on the screen.
    • Automation ID: Identify the element using an Automation ID.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Automation ID: Enter the automation ID of the element to wait for on the screen. Learn how to use the AutomationID property.
    • Class name: Identify the element using a class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Class name: Enter the class name of the element to wait for on the screen.
    • Advanced: Identify the element using a combination of Control type, Name, Automation ID, and Class name.
      • Control type: Choose the control type of the element to detect on the screen. Options include None, Button, CheckBox, ComboBox, Edit, MenuItem, Pane, RadioButton, Text, and Window.
      • Configure the Name, Automation ID, and Class name fields as described above.
    • Specify index: Enter a value to identify an element by its index on the screen. The index can be helpful when more than one element has been found with the specified criteria and you want the one at the specified index. The index is 0-based. This field lets you enter a number, choose a variable, or use the expression editor.
  • Fail if…: Determines the condition under which the action should fail. Available options are:
    • Element not found: After the configured wait time, the element still does not exist on the screen. Use this if the element must be found to continue with the process.
    • More than one element is found: Multiple elements on the page matched the selection criteria as defined in Control type. Use this if you only expected to find one element.
  • Wait time: Lets you specify the maximum amount of time the robotic process should wait for the element before moving on. If the element is found before the defined time, it will continue as soon as the element is found. Choose from these options:
    • Use default max wait time: When selected, the robotic process waits for the default wait time of 30 seconds. If this time elapses without finding the element, the action completes.
    • Enter max wait time: When selected, you can enter the maximum time (in seconds) the robotic process should wait. This number must be greater than zero. If this time elapses without finding the element, the action completes.
    • Don't wait: If the element isn't found, the action completes without waiting.

Output

This method returns a Boolean.

In the OUTPUT area of the method pane, configure the following parameters to store this result:

  • Operator: Select an option to store the result as a single-value variable (is stored as) or add the result as a multiple-value variable (is appended to).
  • Target: Enter the name of the robotic process variable where you want to store or append the result. If your process variable is type CDT, you can specify which field of a CDT to store the result into using dot notation.

This version of the Appian RPA documentation was written for Appian 21.2, and does not represent the interfaces or functionality of other Appian versions.
Open in Github Built: Fri, Oct 22, 2021 (11:11:24 AM)

On This Page

FEEDBACK