Run Browser Operation

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

The Run Browser operation is typically used in functional web tests. It launches the specified web browser and opens the specified web page in it.

Requirements

A license for the TestComplete Web module.

Operation Result

The operation does not return any value.

Scripting Analogue

The actions which the operation performs are similar to the Run 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 one of supported browsers that the operation will launch.

Typically, you choose only the browser name. The operation will launch the browser’s supported version that it finds on the computer where the test will run.

If you want to clarify which browser version you need (for instance, if you need a specific version or a 32-bit or 64-bit edition), 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 browser to be launched. You can either choose the 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 number 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 10:

  • 10
  • 10.0
  • 10.0.8112
  • 10.0.8112.16421

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 on your computer.

Platform

Specifies which browser version you would like to run: 32-bit or 64-bit. You can either choose the platform 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 parameters:

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 the protocol in the URL. Typically, the protocol is either http or https, for example, http://smartbear.com or https://accounts.google.com.

PageLoadWaitTime

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 launching the web browser.
    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 Run Browser operation (and the Navigate 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 Run Browser operation is executed 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 or pages opened in it.

  • If the specified browser is not installed on the computer, the operation will fail.

  • If the specified browser is already running in the system, the operation posts a warning message to the test log. For information on how to determine whether a browser is running, see Checking if Browser Is Running.

  • The operation can run only browsers 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 a browser 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.

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

See Also

Web Category
Navigate Operation
If Browser Operation
Specifying Operation Parameters
Checking Operation Result
Run TestedApp Operation
Testing Web Applications

Highlight search results