NavigateTo Method (Page Objects)

Applies to TestComplete 15.64, last modified on June 12, 2024
This method is obsolete. See the Remarks section below.


The NavigateTo method lets you open the page specified by the URL parameter in a web browser. The NavigateTo method waits until the specified web page is opened. It is similar to the ToUrl method, but does not return any value. If you call NavigateTo, you will have to obtain the Page object corresponding to the loaded page. For more information on this, see Navigate to Web Pages.


TestObj.NavigateTo(URL, WaitTime)

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    
WaitTime [in]    Optional    Integer Default value: -1   
Result None

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.


The method has the following parameters:


The URL to navigate to. It is recommended to specify the protocol in the URL. Otherwise, the page might not be loaded. For example, use rather than

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.

Result Value



  • This method is obsolete. To open the page specified by the URL parameter in a web browser, use the ToUrl method.

  • 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.

  • To determine whether the page has been loaded, the NavigateTo method checks the contentDocument.readyState property of the loaded HTML document for the time specified by the WaitTime parameter. The method exits when the property reports that the loading is complete or when the timeout elapses.

    The method also exits if the loaded web page displays a login dialog. This allows your tests to simulate user actions and to close the dialog.

    This mechanism of determining whether a web page has been completely downloaded is acceptable only for static web pages and is not effective for pages with dynamic content. For more information, see Wait For Web Pages.

  • NavigateTo automatically sets the zoom ratio of the destination page to 100%.


The following example demonstrates how to navigate to a web page:

JavaScript, JScript

function NavigateToSample()

  var page = Sys.Browser().Page("about:blank");


  // Navigate to the web page




def NavigateToSample():
  page = Sys.Browser().Page("about:blank")

  # ...

  # Navigate to the web page

  # ...


Sub NavigateToSample

  Set page = Sys.Browser.Page("about:blank")


  ' Navigate to the web page


End Sub


procedure NavigateToSample();
var page;

  page := Sys.Browser.Page('about:blank');


  // Navigate to the web page



C++Script, C#Script

function NavigateToSample()

  var page = Sys["Browser"]()["Page"]("about:blank");


  // Navigate to the web page



See Also

Classic Web Testing
ToUrl Method (Page Objects)
URL Property (Page Objects)
Wait Method (Page Objects)
Navigate to Web Pages

Highlight search results