Browser Loop Operation

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

The Browser Loop operation is typically used in functional web tests. It launches several specified web browsers one after another, navigates to the specified web page and executes all child operations in each browser.

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 calling the BrowserInfo.Run method in a loop. For more information see, Running Tests in Multiple Browsers.

Child Operations

The operation can have any other operation as a child (or children).

For information on how to make an operation a child of another operation, see the description of the Keyword Test editor’s Test Steps page.

Operation Parameters

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

Select Loop Mode

On this page you define which browsers will be affected:

  • To perform a web test in all the supported browsers that are available on the computer, select the Iterate Through All Browsers option.
  • To perform a web test in particular browsers, choose the Iterate Through Specific Browsers option.
Select Browsers to Iterate Through

This page is shown if you selected Iterate Through Specific Browsers on the “Select Loop Mode” page of the wizard. On this page, you define a list of browsers to be used by the operation:

  • To add a browser to the list, click Add. In the ensuing Add Browser Loop Item wizard, you can select the browser name, and (optionally) define a specific version or edition (32-bit or 64-bit) of the browser instance to be launched.

  • To replace the previously added browser item with another one, click Change and choose a new item.

  • To remove one of the previously added browser items, press Remove.

  • To remove all the previously added browser items, press Clear.

Once the target browsers are defined for the operation, press Next to proceed to the 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://mysite.com or https://my.accounts.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.

Modifying Parameters

After adding the operation to the test, you can modify the operation’s parameters via the same wizard as you used to add the operation. To invoke the wizard, simply double-click the operation’s row in the Keyword Test editor.

To modify parameters of the operation, you can also use the in-place editors and dialogs provided by the Keyword Test editor.

Remarks

  • 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 Browser Loop operation is executed successfully, it makes the launched browser the current browser for the test. The Aliases.Browser object will provide an interface to this browser and web pages or to pages that are open in it.

  • Make sure the child operations contain instructions for closing the current browser. If the browser is not closed upon the current iteration, the operation posts a warning upon the next iteration is complete. To learn how to close the browser , see the Close Web Browsers topic.

    The operation waits until the browser is closed for the time specified by the Auto-wait timeout project setting.

  • If any of the specified browsers 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 Check if Browser Is Running.

  • The operation can run only the 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.

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

See Also

Web Category
Run Browser Operation
Running Tests in Multiple Browsers
Specifying Operation Parameters
Checking Operation Result
Classic Web Testing

Highlight search results