Page Method (Window Objects)

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

The Page method is only added to those window objects that correspond to WebBrowser controls and to Firefox’s window that display web pages. It returns the Page object that corresponds to the browser control displaying a page with the specified URL.

Declaration

TestObj.Page(URL)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
URL [in]    Required    String    
Result A Page object

Applies To

The method is applied to the following object:

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 parameter:

URL

Specifies the URL of the web page opened in the browser. You can use wildcard characters (* and ?) or regular expressions in the ”regexp:pattern“ format to indicate the dynamic parts of the URL, such as values of the query string variables:

WindowObj.Page("http://www.example.com/index.asp?sid=*")

The asterisk (*) corresponds to a string of any length, the question mark (?) corresponds to any single character. To specify more complicated parts of a URL, use regular expressions:

WindowObj.Page("regexp:http://www.example.(com)|(net)|(org)/index.asp\?sid=.*")

Result Value

The Page object that corresponds to the browser control displaying a page with the specified URL. If no page is found, the Page method returns an empty stub object. You can use the Exists property to check whether the page exists or not.

Remarks

  • The Page method is available only if the Web Testing plugins are installed and enabled in TestComplete.

  • You can also obtain the Page object using the Page method of the browser process.

  • During recording, TestComplete can ignore values of specific query string variables in the web page URL and replace them with the * wildcard in the recorded script. To enable this feature, use the Ignore dynamic URL parameters project option.

See Also

Page Object
WaitPage Method (Window Objects)
Page Method (Browser and Process Objects)
Default Web Testing
Navigate to Web Pages

Highlight search results