Interactivity - Check

Declaration

<AMINTERACT ACTIVITY="check" WINDOWTITLE="text" WINDOWCLASS="text" WINDOWHANDLE="text" ACCESSIBILITYENGINE="text (options)" OBJECTPROPERTIES="Toolkit=text,Type=text,Class=text,FrameworkId=text,Name=text,AutomationId=text,Value=text,Role=text,Description=text,X=number,Y=number,Width=number,Height=number,IndexInParent=text,ParentPath=text,Occurrence=number" ACTION="text (options)" EXPRESSION="text"/>

Related Topics   

Overview

Selects or clears a check box or selects a radio button in an open application window.

Practical usage

Commonly used to select, clear, or toggle a check box or a radio button control. Using the Check action is superior to using the Input - Move mouse or Input - Send keystrokes activities (where it can be used) as it natively communicates with the target control and the application is not required to be in the foreground for the event to occur. The Check Action is the only way to ensure that a check box or radio button is set to a specific state as opposed to a simple toggle of the current value.

Parameters

General

This activity comprises Automate Desktop Window Dissection technology to facilitate the discovery of existing window objects and controls. To select the target control:

  1. Ensure the window that contains the desired control is open and in the foreground (in front of all other open windows).
  2. Drag and release the magnifier icon over the control. If the control is supported by this activity, a green border appears around it.
  3. Upon release, the Edit portion of the editor is populated with identified control properties. Individual properties can be enabled/disabled and their values can be further modified. The values for all disabled properties are lost when the activity is saved.
Property Type Required Default Markup Description
Action Text (Options) Yes Check
  • ACTION="uncheck"
  • ACTION="toggle"
  • ACTION="checkif"
  • ACTION="uncheckif"
Specifies the type of interaction to perform on the control. The available options are:
  • Check (Default) - Selects the designated check box or radio button.
  • Uncheck - Clears (unchecks) the designated check box.
  • Toggle - Selects or clears the designated check box, based on its current state.
  • Check if - Uses a valid BASIC expression to select the designated check box or radio button if it is not selected.
  • Uncheck if - Uses a valid BASIC expression to clear (uncheck) the designated check box if it is checked.
Expression (unlabeled) Text Yes, if Action is set to Check if or Uncheck if (Empty)
  • EXPRESSION="%1 &lt; 2%"
  • "EXPRESSION="%1 &gt; 2%"
Specifies the valid BASIC expression to use with the Check if or Uncheck if parameters.
NOTE: All literal strings (strings to be taken as themselves) must be enclosed in double quotation marks (for example, string literal).

Edit

Property Type Required Default Markup Description
By window title Text Yes (Empty) WINDOWTITLE="Microsoft Edge" If enabled, specifies the title of the window that the control search is restricted to. If disabled, this parameter is ignored. Click By window title to select a title, or manually enter a title in the box. This parameter supports wildcard characters (for example, * and ?). For example, entering *Microsoft Edge* restricts a search to only windows containing the text Microsoft Edge in its title.
By window class Text No (Empty) WINDOWCLASS="Outlook Express Browser Class" If enabled, specifies the class of the window that the control search is restricted to. If disabled, this parameter is ignored. Click the down arrow to select a window class from the drop-down list that appears, or enter a window class manually in the provided text box. This parameter supports wildcard characters (that is, * and ?). For example, entering *Microsoft Edge* restricts the search to only window classes containing the text Microsoft Edge.
By window handle Number No (Empty) WINDOWHANDLE="555735" If enabled, specifies the handle of the window that the control search is restricted to. If cleared or set to 0, this parameter is ignored. Use this parameter to distinguish a window from other instances containing an identical title/class.
Accessibility engine Text (options) No Auto
  • ACCESSIBILITYENGINE="auto"
  • ACCESSIBILITYENGINE="ui_automation"
  • ACCESSIBILITYENGINE="active"
  • ACCESSIBILITYENGINE="java"
The accessibility engine to use to programmatically collect accurate information about a user interface to interact with it. The available options are:
  • Auto - Starting with UI Automation, Automate Desktop detects which accessibility engine to use based on the control properties.
    NOTE: Some controls might not be compatible with this option and require one of the other accessibility engine options to be manually selected for best results.
  • UI Automation - Uses UI Automation, which is Microsoft's standard for exposing information about its user interface.
  • Active - Uses Active Accessibility, which uses an older Microsoft engine for exposing information about its user interface.
  • Java - Uses Java Access Bridge, which is a technology that enables certain Java applications and applets to be visible to assistive technologies on Microsoft Windows systems.
Browse Button No -- -- Allows you to manually traverse the list of available controls for a window selected either by the magnifier icon or manually by the By window title property.

In some cases, the desired control cannot be selected using the magnifier icon. If this occurs, use the magnifier icon to select any control, and click Browse. Select the desired control from the list in the Object Browser and then click OK. The Object properties for the selected control will now be populated.

Controls can also be selected without the aid of the magnifier icon by enabling the By window title property and manually selecting the window the desired control is located in from the list. After selecting a window, click Browse. Select the desired control from the list in the Object Browser and click OK. The Object properties for the selected control are now populated.

NOTE: It is not recommended to select a control without using the magnifier icon. Doing so can result in selecting a control that is not supported by this activity and cause the step to fail when attempting to run it.
Object properties Text No (Varies) OBJECTPROPERTIES="Toolkit
=WindowsAccessibility,Type=data,
Class=DockingPane,Name=Line,
Value=text,X=300,Y=200"
Contains standard Window Dissection parameters used to describe objects, controls, or text inside a window. This section can define additional characteristics to precisely designate a window or matching object. To enable/disable a specific property, select or clear the associated check box. To modify the value of a specific property, enter the desired value in the Value field.
Toolkit Text No (Empty)
  • TOOLKIT=UIAutomation
  • TOOLKIT=WindowsAccessibility
  • TOOLKIT=JavaAccessibility

If enabled, specifies the toolkit (a set of basic building units for graphical user interfaces) is examined when determining a matching object. If disabled, the toolkit is ignored.

The displayed toolkit is based on the Accessibility engine selected:

  • UI Automation - UIAutomation
  • Active - WindowsAccessibility
  • Java - JavaAccessibility
Type Text No (Empty) TYPE=PushButton If enabled, specifies the object type (button, check box, trackbar) is examined when determining a matching object. If disabled, the type is ignored.
Class Text No (Empty) CLASS=SysTreeView32 If enabled, specifies the object class (XTPToolBar, SysTreeView, MDIClient) is examined when determining a matching object. If disabled, the class is ignored.
FrameworkId Text No (Empty) FRAMEWORKID=WPF If enabled, specifies the object framework ID (the framework technology used to create the object) is examined when determining a matching object. If disabled, the framework ID is ignored.
Name Text No (Empty) NAME=Cancel If enabled, specifies the object's name (a unique identifier for an object) is examined when determining a matching object. If disabled, the name is ignored.
AutomationId Text No (Empty) AUTOMATIONID=System If enabled, specifies the object automation ID (a unique identifier for an object) is examined when determining a matching object. If disabled, the automation ID is ignored.
Value Text No (Empty) VALUE=1 If enabled, specifies the object value (which usually coincides with the Name property) is examined when determining a matching object. If disabled, the value is ignored.
Role Text No (Empty) ROLE=desktop pane If enabled, specifies the object role type (the control type provided by the Java Accessibility bridge) is examined when determining a matching object. If disabled, the role type is ignored.
Description Text No (Empty) DESCRIPTION=JScrollPane If enabled, specifies the object description (the description given for an object) is examined when determining a matching object. If disabled, the description is ignored.
X Number No (Empty) X=80 If enabled, specifies the object X coordinate (a given number of pixels along the horizontal axis of a window starting from the extreme left side) is examined when determining a matching object. If disabled, the X coordinate is ignored.
NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.
Y Number No (Empty) Y=90 If enabled, specifies the object Y coordinate (a given number of pixels along the vertical axis of a window starting from the top-most portion) is examined when determining a matching object. If disabled, the Y coordinates is ignored.
NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.
Width Number No (Empty) WIDTH=711 If enabled, specifies the object pixel width is examined when determining a matching object. If disabled, the pixel width is ignored.
Height Number No (Empty) HEIGHT=421 If enabled, specifies the object pixel height is examined when determining a matching object. If disabled, the pixel height is ignored.
IndexInParent Text No (Empty) INDEXINPARENT=1 If enabled, specifies the object index in parent number (the numeric identifier of a child object located within a parent object) is examined when determining a matching object. If disabled, the index in the parent number is ignored.
ParentPath Text No (Empty) PARENTPATH=50032|50033 If enabled, specifies the object parent path (the sequence of control type identifiers that lead to the object) is examined when determining a matching object. If disabled, the parent path is ignored.
Occurrence Number No (Empty) OCCURRENCE=1 If enabled, specifies the object occurrence (the numeric identifier of an object, useful when multiple matching objects are found) is examined when determining a matching object. If disabled, the occurrence is ignored.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

The following sample task selects the checkbox Show in an application if it is not currently selected:

Copy
<AMINTERACT ACTIVITY="check" WINDOWTITLE="Preferences" OBJECTPROPERTIES="Toolkit=UIAutomation,Type=50002,Class=,FrameworkId=Win32,Name=Show,AutomationId=,Value=,ParentPath=50032|50002,Occurrence=,X=,Y=" ACTION="checkif" EXPRESSION="%1 &lt; 2%" />