Applies to TestComplete 14.10, last modified on June 5, 2019

Description

The Page method returns a Page object that corresponds to the opened web page with the specified URL.

This method is added to processes that correspond to the supported web browsers as well as to the WPF Host process (PresentationHost) that executes WPF XAML Browser applications (XBAP). The method is available only when the Web Testing plugins are installed in TestComplete.

Declaration

TestObj.Page(URLIndex)

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    
Index [in]    Optional    Integer Default value: 0   
Result A Page object

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:

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:

Sys.Browser("iexplore").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:

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

Index

This parameter is only used if you open two or more pages with the same URL in the browser. In this case, these pages have the same URL, so to distinguish the pages, TestComplete uses the Index parameter. The parameter specifies the order in which the pages were opened. If there is only one page with the specified URL, the Index parameter is not used.

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 of the returned object to check whether the page exists.

We do not recommend calling the Exists property in a loop to wait for a page. Use the WaitPage method instead. See also Waiting For Web Pages.

Remarks

  • To open a new web page in a browser, use the ToUrl method.

  • 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

Testing Web Applications
Page Object
WaitPage Method (Process Objects)
Page Method (Window Objects)
ToUrl Method (Browser Objects)
Navigating to Web Pages
Waiting For Web Pages

Highlight search results