Run Virtual Browser Operation

Applies to TestComplete 15.0, last modified on November 17, 2021

Description

The Run Virtual Browser operation launches the mobile browser emulator with the specified URL (if any). You can choose one of the predefined mobile browser profiles – Apple iPhone 7, Samsung Galaxy S3 and others – or use a custom browser profile defined in your test project. For more information, see Testing Mobile Web Applications Using Emulator.

To repeat the test operations in multiple mobile browsers in a loop, use the Virtual Browser Loop operation.

Requirements

  • A license for TestComplete Web module

  • The Web Testing and Chrome Support plugins (they are part of the Web module).

  • Google Chrome 94.

    If you have a TestComplete version earlier than 12.42, your version of the SmartBear Test Extension will be incompatible with newer versions of the Chrome web browser. To test web applications in Chrome 94, you will have to upgrade your TestComplete to some later version. We recommend using version 15.0.

    If you use a later version of Google Chrome, check whether a patch is available for it.

For details, see Requirements for Mobile Web Testing Using Emulator.

Chrome must not be running before the operation is run. See Remarks below.

Operation Result

The operation does not return any value.

Scripting Analogue

The operation does the same as the VirtualBrowsers.Item(browser_name).Run method.

Child Operations

The operation cannot have child operations.

Operation Parameters

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

Select Virtual Browser

Here you can select the mobile browser to emulate. The page lists all mobile browser profiles that are defined in the project’s Virtual Browsers table, except for those that are unchecked in the table.

If you want to specify a mobile browser name using a variable or a parameter, select Parameterize.

Browser Selection Parameters

If you selected Parameterize on the Select Virtual Browser page, you will see this page. It contains one parameter:

NameOrIndex

Required. A string with the name of a mobile browser profile, or its integer index (zero-based) in the project’s Virtual Browsers table. You can select a mobile browser profile from the drop-down list or specify a constant, test parameter, project variable or code expression that returns the profile name or index.

For more information about specifying parameter values, see Specifying Operation Parameters.

Operation Parameters

Here you can specify the following parameters:

URL

The URL to be opened in the mobile browser emulator. Specify the protocol (for example, http:// or https://) at the beginning of the URL.

If left empty, TestComplete starts the mobile browser emulator with a blank page (about:blank).

PageLoadWaitTime

The time, in milliseconds, to wait until the page is loaded and ready to accept user input. The operation execution finishes once the page is loaded completely or this timeout is reached.

If omitted or -1, the timeout is specified by the project’s Web page loading timeout property.

Remarks

  • Google Chrome must not be running before the operation is run. If Chrome is already running, the operation opens a new tab in the running Chrome instance rather than starts the Chrome mobile emulator.

    You can use the If Browser operation to check if Chrome is running and close it if it is. See Check if Browser Is Running and Close Web Browsers.

  • After the mobile browser emulator is launched, the Aliases.browser object points to the browser emulator and provides access to the web pages that are open in it.

  • The operation logs an event message if it succeeded and an error message if it failed.

See Also

Testing Mobile Web Applications Using Emulator
Web Category
Virtual Browser Loop Operation
Specifying Operation Parameters
Checking Operation Result

Highlight search results