OnOverlappingWindow Event

Applies to TestComplete 15.69, last modified on November 13, 2024

Occurs when an overlapping window appears.

Declaration

OnOverlappingWindow(SenderWindowOverlappingWindowLogParams) Parameters
Sender [in] Required Variant
Window [in] Required An OnscreenObject object
OverlappingWindow [in] Required An OnscreenObject object
LogParams [in] Required A LogParams object

Description

The event occurs when your script tries to simulate a mouse click over a window or control, but that window or control is overlapped by another window or control so that the click cannot be executed. If the Ignore overlapping window option in the Playback settings of your project dialog is enabled, TestComplete ignores the overlapping window and continues the script run. If this option is off, the script execution is halted. Write an OnOverlappingWindow event handler to perform desired actions if an overlapping window appears. For instance, you can post an image of the overlapping window to the log or stop the script if an “unknown” overlapping window appears.

Important Notes:

  • If the OnOverlappingWindow event handler simulates a mouse click, TestComplete will check for an overlapping window and if the click is performed over the overlapped window, the event handling routine will be called recursively. To avoid recursion, do not simulate mouse clicks or keypresses over the overlapped window within this event handler.

  • The OnOverlappingWindow event does not work for windowless objects. That is, if the target window or control is overlapped by a windowless object (for example, a modal object implemented in a web application with a div element) the event does not occur. For more information, see Handling Unexpected Windows.

Parameters

The event has the following parameters:

Sender

The Event control that processes the event.

Window

Specifies the OnscreenObject object (window or control) to which a mouse click or a keypress is addressed.

OverlappingWindow

Specifies the OnscreenObject object that overlaps the Window.

LogParams

Properties of the LogParams object hold text, priority, color and other attributes of the error message posted to the log. The Locked property of this object is meaningful only if the Ignore overlapping window project option is disabled. It lets you specify whether TestComplete should cancel further processing of the overlapping window. Setting Locked to True will tell TestComplete to ignore the overlapping window. If the option is on, TestComplete will always ignore this window regardless of the Locked value.

Remarks

For information on how to create an event handler for this and other TestComplete events, see Handling Events.

See Also

Handling Unexpected Windows
OnUnexpectedWindow Event
Handling Events
Event Control
Testing Modal Windows

Highlight search results