ToUrl method loads a page specified by the URL parameter in the browser and returns the
Page object that corresponds to the loaded page.
|TestObj||A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section|
|WaitTime||[in]||Optional||Integer||Default value: -1|
The method is applied to the following object:
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
The method has the following parameters:
The URL to navigate to. It is recommended that you specify the protocol in the URL, otherwise the page may not be loaded. For example, use http://www.example.com rather than www.example.com.
If the tested web page is located on your computer, then to make your script computer-independent, use the server name rather than localhost when specifying the page’s URL, that is, for instance, use the URL http://mycomp/path/mypage.htm rather than http://localhost/path/mypage.htm. See Computer-Specific Settings for more information about this.
Specifies the time (in milliseconds) to wait until the browser loads the page and becomes ready to accept user input. If WaitTime is omitted, the timeout is specified by the project’s Web page loading timeout option. After the specified time limit is reached, the test execution proceeds.
Page object that corresponds to the newly loaded web page.
If the method navigates to a web page successfully, it posts an event message to the test log.
If the method cannot navigate to a web page, it fails and posts an error message to the test log.
ToURL automatically sets the zoom ratio of the destination page to 100%.
When recording actions that open a web page, TestComplete automatically transforms them into the appropriate calls to the
ToUrl method. However, a method call is not inserted into the test, unless some other actions (mouse clicks, keyboard input, checkpoints, etc.) are performed over the opened page.
To view an example that demonstrates how to use the
ToURL method, see Navigating to Web Pages.