Interactivity - Move mouse to object

Declaration

<AMINTERACT ACTIVITY="mouse_to_object" WINDOWTITLE="text" WINDOWCLASS="text" WINDOWHANDLE="number" ACCESSIBILITYENGINE="text (options)" OBJECTPROPERTIES="Toolkit=text,Type=text,Class=text,Name=text,Value=text,X=number,Y=number" SCROLLINTOVIEW="YES/NO" />

Description

Moves the mouse cursor to the center of an object or control on a window such as a button, tab, text-box, link or column header. To select an object from an existing window, drag and release the magnifier icon over the desired object. Use the Browse... button to define additional properties in order to precisely specify a matching object.

Practical Usage

Commonly used to move the mouse cursor to an object on a window or desktop. A Click Mouse step can follow this activity in order to click the object that the mouse cursor was moved to. This activity can also be used to move the cursor to a specific item on the desktop, such as an icon, task bar or system tray item before clicking it. Using this activity is superior to using the Move Mouse activity (where it is able to be used) because it communicates with the target control natively and will continue to work even if the control is moved in subsequent sessions.

Parameters

General

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

  1. Make certain 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 will appear around it.
  3. Upon release, the Edit portion of the editor is populated with identified control properties. Individual controls can be enabled/disabled or their properties further modified.

Property

Type

Required

Default

Markup

Description

Scroll object into view (IE only)

Yes/No

No

No

SCROLLINTOVIEW="YES"

If set to YES, causes the object to scroll into view, aligning it either at the top or bottom of the window (set to NO by default).

Edit

Property

Type

Required

Default

Markup

Description

By window title

Text

Yes

(Empty)

WINDOWTITLE="Microsoft Internet Explorer"

If enabled, specifies the title of the window that the control search should be restricted to. If disabled, this parameter is ignored. Click the down arrow to select a title from the drop-down list that appears or enter a title manually in the provided text-box. This parameter supports wildcard characters (i.e. * and ?). For example,  entering *Internet Explorer* would restrict the search to only windows containing the text "Internet Explorer" 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 should be 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 (i.e. * and ?). For example,  entering *Internet Explorer* would restrict the search to only window classes containing the text "Internet Explorer."

By window handle

Number

No

(Empty)

WINDOWHANDLE="555735"

If enabled, specifies the handle of the window that the control search should be restricted to. If disabled or set to 0, this parameter is ignored. Use this parameter as a way to  distinguish a particular window from other instances containing an identical title/class.

Accessibility engine

Text (options)

No

Auto

  1. ACCESSIBILITYENGINE="auto"

  2. ACCESSIBILITYENGINE="active"

  3. ACCESSIBILITYENGINE="java"

  4. ACCESSIBILITYENGINE="ie"

The accessibility engine that this activity will use to programmatically gather accurate information about a user interface in order to interact with it. The available options are:

  • Auto (default) - AutoMate will detect the best accessibility engine to use based on current properties.
  • Active - Active Accessibility will be used. Active Accessibility is Microsoft's standard for exposing information about its user interface.
  • Java - Java Access Bridge will be used, which is a technology that enables certain Java applications and applets to be visible to assistive technologies on Microsoft Windows systems.
  • Internet Explorer - Internet Explorer DOM will be used, which is the Document Object Model used to represent objects in a web page (i.e. text, images, headers, links, etc.).

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 be used to define additional characteristics in order to precisely designate a window or matching object. To enable/disable a specific property, check or un-check its associated check-box. To modify the value of a specific property simply enter the desired value in the Value field.   Click the Browse... button to open the Object Browser dialog, which can be used to search for additional criteria about a given window. Available object properties are described below.

Toolkit

Text

No

(Empty)

TOOLKIT=WindowsAccessibility

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

Type

Text

No

(Empty)

TYPE="PushButton"

If enabled, specifies that the object type (i.e. Button, Checkbox, Trackbar) will be examined when determining a matching object. If disabled, the object type will be ignored.

Class

Text

No

(Empty)

CLASS="SysTreeView32"

If enabled, specifies that the object class (i.e. XTPToolBar, SysTreeView, MDIClient) will be examined when determining a matching object. If disabled, the object class will be ignored.

Name

Text

No

(Empty)

NAME="Cancel"

If enabled, specifies that the object name (the unique identifier for an object) will be examined when determining a matching object. If disabled, the object name will be ignored.

Value

Text

No

(Empty)

VALUE="1"

If enabled, specifies that the value of the object (which usually coincides with the Name property) will be examined when determining a matching object. If disabled, the object value will be ignored.

X

Number

No

(Empty)

X="80"

If enabled, specifies that the object's X coordinate ( a given number of pixels along the horizontal axis of a window starting from the extreme left side) will be examined when determining a matching object. If disabled, the X coordinate will be 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 that the object's Y coordinate ( a given number of pixels along the vertical axis of a window starting from the top-most portion) will be examined when determining a matching object. If disabled, the Y coordinates will be ignored.

NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.

 

Description

Error Causes

On Error

example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description

This sample task runs the following steps:

  1. An Open Web Page action opens the web page www.google.com.

  2. A Set Text action sets the text "Business Process Automation Software" in the search box.

  3. A Move Mouse to Object action moves the mouse cursor to the "Google Search" button.

  4. A Click Mouse action clicks the "Google Search' button.

<AMBROWSER URL="www.google.com/" SESSION="BrowserSession1" />

<AMINTERACT ACTIVITY="set_text" WINDOWTITLE="Google - Windows Internet Explorer" OBJECTPROPERTIES="Type=SelectableText,Name=Google Search,Value=,Class=Internet Explorer_Server,X=,Y=" TEXT="Business Process Automation Software" />

<AMINTERACT ACTIVITY="mouse_to_object" WINDOWTITLE="Google - Windows Internet Explorer" OBJECTPROPERTIES="Type=PushButton,Name=Google Search,Value=,Class=Internet Explorer_Server,X=,Y=" />

<AMINPUT ACTIVITY="click_mouse" />