ClickItemRXY Action (Specific to Win32, MFC ToolBar and MFC MenuBar Controls)

Applies to TestComplete 14.60, last modified on April 22, 2021
This method is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This method can be only used in tests that locate web objects by using internal identification properties provided by TestComplete.

Description

ClickItemRXY moves the mouse to the specified Item, then using item coordinates (0, 0 at top left) ClickItemRXY simulates a single click of the right mouse button at point X, Y.

Declaration

TestObj.ClickItemRXY(ItemXYBy PositionShift)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Item [in]    Required    Variant    
X [in]    Required    Integer    
Y [in]    Required    Integer    
By Position [in]    Optional    Boolean Default value: True   
Shift [in]    Optional    TShiftKey Default value: skNoShift   
Result None

Applies To

The method is applied to the following objects:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

Item

Specifies the item you want to click. You can specify the item using the item’s caption, id or position in the control. For more information, see the Remarks section.

X

Specifies the horizontal coordinate of the mouse cursor when clicking. The coordinate is relative to the top left of the item.

Y

Specifies the vertical coordinate of the mouse cursor in the moment of clicking. The coordinate is relative to the top left of the item.

By Position

Sets whether the Item parameter holds the item’s id or position in the control. For more information, see the Remarks section.

Shift

Specifies whether the CTRL, ALT or SHIFT keys will be pressed during the click. The default value is skNoShift (no shift key pressed). See TShiftKey.

Result Value

None.

Remarks

  • You can specify the desired control’s item by assigning item’s caption, identifier or position on the control to the Item parameter. Therefore, if this parameter holds a string, TestComplete identifies the item by caption. When Item specifies the caption, you can use wildcards (* and ?) or regular expressions to mark variable parts of the caption. The caption can be case-sensitive or case-insensitive depending on the value of the Use case-sensitive parameters project setting. If Item holds an integer value, then TestComplete checks the ByPosition parameter to determine in what way to identify the item: if ByPosition is True, TestComplete treats the Item value as the item position; if ByPosition is False, TestComplete treats the Item value as an identifier.

  • If Item is not found, ClickItemRXY fails and posts an error message to the test log.

  • Desktop testing: If TestObj refers to an object of a non-DPI-aware application running with a DPI setting other than 100%, set the X and Y parameter values relative to the application (as if the application is running with the 100% DPI setting).

  • Web testing: If the Use CSS pixels for scaled pages option is enabled (by default), set the X and Y parameter values relative to the web page, regardless of the browser zoom and the system's DPI setting.

Example

To view an example that demonstrates how to use the ClickItemRXY action, see Selecting Toolbar Buttons.

See Also

Selecting Toolbar Buttons
ClickItemRXY Action (ToolBar Controls)
ClickItem Action (Specific to Win32, MFC ToolBar and MFC MenuBar Controls)
ClickItemXY Action (Specific to Win32, MFC ToolBar and MFC MenuBar Controls)
ClickItemR Action (Specific to Win32, MFC ToolBar and MFC MenuBar Controls)
DblClickItem Action (Specific to Win32, MFC ToolBar and MFC MenuBar Controls)
wButtonPos Property (ToolBar and MenuBar Controls)
wButtonID Property (ToolBar and MenuBar Controls)
wButtonText Property (Specific to Win32, MFC ToolBar and MFC MenuBar Controls)

Highlight search results