Page Object Methods

Applies to TestComplete 15.70, last modified on December 17, 2024

This topic lists built-in methods provided by TestComplete for Page test objects.

In addition to these methods, the Page test object contains native methods provided by the web browser:

Method List   | View

Standard

This category includes methods that TestComplete applies to all test objects.

Name Description
Child Returns a child object by its index.
Find Searches for a child object that has the specified property values.
FindAll Returns an array of child objects that have the specified property values.
FindAllChildren Returns an array of child objects that have the specified property values.
FindChild Searches for a child object that has the specified property values.
FindChildEx Searches for a child object that has the specified property values during the specified timeout period.
FindEx Searches for a child object that has the specified property values during the specified timeout period.
FindId Returns a child object by its identifier.
PagePicture Captures the image of the specified rectangular area of the tested web page. The specified rectangle may include page regions that are not shown and are accessed via the scroll bars.
Picture Captures the image of the specified rectangular area of the object.
Refresh Refreshes the child object list.
ScreenToWindow Converts screen coordinates to coordinates relative to the object.
ToUrl Opens the specified page.
Validate Obsolete. Generates the OnValidate event for the object.
WaitChild Waits until the specified child object becomes available during the timeout period.
WaitProperty Waits until the specified object property achieves the specified value during the timeout period.
WindowToScreen Converts coordinates relative to the object to screen coordinates.
Actions

This category includes methods that simulate user actions on the tested controls.

Name Description
Click Simulates a click of the left mouse button over the object.
ClickM Simulates a click of the middle mouse button over the object.
ClickR Simulates a click of the right mouse button over the object.
DblClick Simulates a double-click of the left mouse button over the object.
DblClickM Simulates a double-click of the middle mouse button over the object.
DblClickR Simulates a double-click of the right mouse button over the object.
Drag Simulates a dragging event performed with the left mouse button.
DragM Simulates a dragging event performed with the middle mouse button.
DragR Simulates a dragging event performed with the right mouse button.
HoverMouse Simulates moving the mouse pointer to the specified position within an object.
Keys Sends a keystroke to an object.
LongTouch WebView specific. Simulates a long touch on an object.
MouseWheel Simulates rotation of the mouse wheel over an object.
Touch WebView specific. Simulates a touch on an object.
Extended

This category includes methods that extend test functionality for the Page objects.

Name Description
Close Closes the web page.
EvaluateXPath Searches for all the web objects on a page that have the specified attribute values. The search expression has the XPath syntax.
FindChildByXPath Searches for the first child object on a page that has the specified attribute values. The search expression has the XPath syntax.
FindElement Searches for the first web element that matches the specified condition. The search condition can be either an XPath expression or a CSS selector.
FindElement Searches for all elements on a web page that match the specified condition. The search condition can be either an XPath expression or a CSS selector.
QuerySelector Searches for the first web page element that matches the specified CSS selector.
QuerySelectorAll Searches for all web page elements that match the specified CSS selector.
WaitElement Pauses the script execution until a web element specified by the search condition becomes available. The search condition can be either an XPath or a CSS selector.
Open App Objects

This category includes methods that provide access to child objects (windows or controls) that the tested window may have. In general case, a child object can be created with any supported development tool or technology. That is why the category includes methods for accessing objects whose technology differs from the technology of the given window object.

Name Description
Alert Provides access to an alert that the web page is showing.
Confirm Provides access to a message box that the web page is showing.
Login Provides access to a login dialog that the web page is showing.
Prompt Provides access to an input box that the web page is showing.
WaitAlert Delays the test run until an alert becomes available on the web page or until the specified period is over.
WaitConfirm Delays the test run until a message box becomes available on the web page or until the specified period is over.
WaitLogin Delays the test run until a login dialog becomes available on the web page or until the specified period is over.
WaitPrompt Delays the test run until an input box becomes available on the web page or until the specified period is over.
<Name Mapping>

These methods are available only if the test object has been mapped (see Name Mapping). You can use them in your tests, but they are not displayed in the Object Browser panel.

Name Description
AddNamedChild Adds the specified child object to Name Mapping.
GetUnderlyingObject Returns the test object, to which the given mapping item corresponds.
RefreshMappingInfo Instructs TestComplete to re-identify the mapped object using the identification information specified in Name Mapping.
RemoveNamedChild Deletes the specified child mapped object from Name Mapping.
WaitAliasChild Waits until the child object with the specified alias becomes available during the timeout period.
WaitNamedChild Waits until a child object with the specified mapped name becomes available during the timeout period.
Other Categories

Name Description
Find Searches for an HTML object on a page using that object’s property value. This method belongs to the Page.NativeWebObject namespace.
NavigateTo Obsolete. Navigates to the specified web page.
Wait Pauses the script execution until the specified web page is downloaded.

If TestComplete has access to internal methods, properties and files of your tested application (that is, if it is an Open Application), you can call the internal methods and properties as methods and properties of the appropriate test objects. You can view these properties and methods in corresponding categories (Private, Public, RTTI, Debug Agent, Firefox, and so on). These methods and properties are not described in the TestComplete help file. For more information on them, please see the documentation for the development tools that was used to create the application under test.

See Also

Page Object
Page Object Properties

Highlight search results