Navigate Operation

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

Description

The Navigate operation is used in functional web tests. It opens the web page specified by the operation parameters in the running instance of the specified web browser or in the browser that is current for your test. If the specified browser is not running or a test does not have a current browser, an error will occur.

Requirements

A license for TestComplete Web module.

Operation Result

The operation does not return any value.

Scripting Analogue

The actions which the operation performs are similar to the Navigate method of the BrowserInfo object.

Child Operations

The operation cannot have child operations.

Operation Parameters

When you add the operation to your keyword test, TestComplete displays a wizard that contains the following pages.

Select Browser

On this page you can choose the browser in which the operation will open the tested web page.

To navigate to the web browser that is current for your test, select Current Browser from the list. This operation is equal to the Browsers.CurrentBrowser.Navigate method.

You can also choose a specific browser (Chrome, Edge, Internet Explorer, or Firefox) to navigate to. Typically, you choose the browser name only. The operation will check whether the browser is running and open the page in it.

If you want to clarify the browser version you need (for instance, if you need a specific version or a 32-bit or 64-bit version), select Parameterize and click Next. You will be able to specify the version details on the next page of the wizard.

Browser Selection Parameters

This page is shown if you selected Parameterize on the “Select Browser” page of the wizard. It contains the following parameters:

Browser

Required. A string or integer value that specifies the desired browser. You can choose the desired browser from the drop-down list or specify a constant, test parameter, project variable or code expression that returns one of the following values:

String Value Constant Integer Value
Internet Explorer btIExplorer -1
Firefox btFirefox -2
Chrome btChrome -3
Edge btEdge -6

For information on various methods for specifying parameter values, see Specifying Operation Parameters.

Version

Optional. Specifies the browser version you would like to use.

You can specify the version in various numeric formats: major version only, major + minor version, major + minor + build number. Literal characters are not taken into account. Below are some examples valid for Internet Explorer 11:

  • 11
  • 11.0
  • 11.0.165
  • 11.535.18362

It is recommended that only the major version be specified. When specifying a minor version and build number, check whether you entered correct values. A misprint in one of the digits will cause the operation to fail, as it will not be able to find the specified browser.

Platform

Specifies which browser version you would like to run: 32-bit or 64-bit. You can either choose the value from the drop-down list or specify a constant, test parameter, project variable or code expression that returns one of the following values:

Constant Integer Value Description
pX86 0 32-bit edition of the browser.
pX64 1 64-bit edition of the browser.
pAny -1 Any available version of the browser.

If you have both 32- and 64-bit versions, the 32-bit version will be used.

For information on various methods for specifying parameter values, see Specifying Operation Parameters.

Operation Parameters

On this page you can specify the following parameter:

Url

Specifies the URL of the web page that will be opened by the browser after it is launched.

Note: It is recommended that you specify protocol in the URL. Typically, the protocol is http or https, for example, http://mysite.com or https://my.accounts.com.

WaitTime

Specifies the time (in milliseconds) to wait until the browser loads the page and becomes ready to accept user input. If this parameter is omitted or set to -1 (the default value), the timeout is specified by the project's Web page loading timeout option. After the specified time limit is reached, the test execution proceeds.

Remarks

  • To improve the Firefox performance, the method automatically configures some Firefox settings before navigating to the specified web page.
    These settings will not be restored to their initial values after the test run is over.

    To prevent TestComplete from modifying your Firefox settings, do not use the Navigate operation (and the Run Browser operation) in your test. As a workaround, you can launch Firefox by using the Run TestedApp operation and navigate to web pages by simulating user actions on the browser's address bar.

  • If the operation navigates to a web page successfully, it posts an event message to the test log.

  • If the operation cannot navigate to a web page, it fails and posts an error message to the test log.

  • If the Navigate operation executes successfully, it makes the launched browser the current browser for the test. The Aliases.Browser object will provide interface to this browser and web pages opened in it.

  • If the specified browser is not running, the operation will fail. For information on how to determine whether a browser is running, see Check if Browser Is Running.

  • The operations work only with browsers that are supported by TestComplete (see Supported Web Browsers and Technologies). If you specify an unsupported browser, the operation will post an error message to the log.

  • If your tests uninstall or install browsers during the run, call the Browsers.Refresh method before the first test command that navigates to a web page, launches a browser or performs any other browser-related operation after the installation or uninstallation is over.

  • When recording actions that open a web page, TestComplete automatically transforms them into the appropriate calls to the Navigate operation. However, the operation is not inserted into the test, unless some other actions (mouse clicks, keyboard input, checkpoints, etc.) are performed over the open page.

  • For information on various parameters that can be used for setting operation properties, see Specifying Operation Parameters.

See Also

Web Category
Run Browser Operation
Specifying Operation Parameters
Checking Operation Result
Default Web Testing

Highlight search results