The Virtual Browser Loop operation lets you repeatedly perform test operations in multiple mobile browsers, one after another. On each loop iteration, the operation does the following:
Launches the mobile browser emulator with the next browser profile.
Navigates to the specified URL (if any).
Executes the child operations.
Using this operation, you can create cross-browser tests for mobile web applications. For more information, see Testing Mobile Web Applications Using Emulator and Creating Cross-Browser Mobile Web Tests.
To run the test in a specific mobile browser, you can use the Run Virtual Browser operation instead.
A license for TestComplete Web module
The Web Testing and Chrome Support plugins (they are part of the Web module).
Google Chrome 118.
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 118, you will have to upgrade your TestComplete to some later version. We recommend using version 15.59.
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.|
The operation does not return any value.
In scripted tests, the analogue of Virtual Browser Loop is a loop statement that calls the
VirtualBrowsers.Item(browser_name).Run method and the needed test operations. For more information see, Creating Cross-Browser Mobile Web Tests.
The operation can have any other operation as a child.
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.
When you add the operation to your keyword test, TestComplete displays a wizard with the following pages:
Select Loop Mode
Here you can choose whether to use all the available mobile browser profiles or only specific ones:
Iterate Through All Enabled Virtual Browsers - Use all the mobile browser profiles specified in the project’s Virtual Browsers properties, except for those that are unchecked in the table.
In this case, you can change the browser list for the test by modifying the Virtual Browsers table in the project properties. For example, the newly added Virtual Browsers items will be automatically included in the test run. Similarly, the browser profiles that are unchecked in the table will be excluded from the test run.
Iterate Through Specific Virtual Browsers - Select mobile browser profiles for the test manually. Use this option if your project’s tests need to be run in different browsers. For example, one test needs to use iOS browsers and another - Android browsers; or you need to use phone or tablet browsers.
Select Browsers to Iterate Through
This page is displayed if you selected Iterate Through Specific Virtual Browsers on the Select Loop Mode page. Here you can specify the mobile browser profiles to be used.
To add a browser to the list, click Add and select the needed browser.
To replace the selected browser with another one, click Change and choose a new browser.
To delete the selected item, click Remove.
To delete all the browsers from the list, click Clear.
Once done, click Next to continue.
Here you can specify the following parameters:
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 will start the mobile browser emulator with a blank page (about:blank).
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.
You can modify the parameters of an existing Virtual Browser Loop operation in the following ways:
Double-click the operation in the Keyword Test editor and go through the wizard once again.
Use the operation’s in-place editors in the Keyword Test editor.
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.
For the same reason, Chrome must be closed at the end of each loop iteration. Make sure one of the Virtual Browser Loop’s child operations closes Chrome. The operation waits until the browser is closed during the project’s Auto-wait timeout.
If the operation uses the Iterate Through Specific Virtual Browsers option and one of the specified browser profiles is not found (for example, it was unchecked or deleted from the project’s Virtual Browsers properties), the operation fails.
After the mobile browser emulator is launched, the
Aliases.browserobject 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.