WaitPage Method (Mobile Objects)

Applies to TestComplete 15.47, last modified on January 20, 2023
This method is available in legacy mobile tests that work with devices connected to the local computer. To learn how to simulate user actions in newer cloud-compatible mobile tests, see the Simulating user actions in tests section.

Description

The WaitPage method pauses the test execution until a Page object with the specified URL appears in the object hierarchy or until the specified timeout elapses.

Declaration

TestObj.WaitPage(URL, Timeout)

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    
Timeout [in]    Required    Integer    
Result A Page object

TestObj.WaitPage(URL, Index, Timeout)

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]    Required    Integer    
Timeout [in]    Required    Integer    
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 being loaded. You can use wildcard characters * and ? to indicate the dynamic parts of the URL, such as values of the query string variables:

WebViewObj.WaitPage("http://www.example.com/index.asp?sid=*", 5000)

The asterisk (*) corresponds to a string of any length, the question mark (?) corresponds to any single character.

Index

This parameter is used if you open two or more web pages that have the same URL. The parameter is used to distinguish the pages from each other. It specifies the order, in which the pages were opened. The indexing starts from 1. However, Index is not used, if the browser contains only one page with the specified URL. If you open several pages that have the same URL, then TestComplete will not use Index to obtain the page that was opened first, and will use the indexes 2, 3, 4 and so on to obtain the other pages.

Timeout

The number of milliseconds to wait until the specified web page is loaded. If Timeout is 0, the method returns immediately. If Timeout is -1, the wait time is infinite.

Result Value

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

Remarks

The WaitPage method waits for the corresponding Page object to become available. It does not wait for the page content to be fully downloaded. See Waiting for Web Pages in Hybrid Mobile Applications (Legacy) for information on specifics of loading web pages and for code samples.

See Also

Testing Hybrid Mobile Applications (Legacy)
Navigating to Web Pages in Hybrid Applications (Legacy)
Waiting for Web Pages in Hybrid Mobile Applications (Legacy)

Highlight search results