Preparing Chrome for Web Testing

Applies to TestComplete 15.20, last modified on January 19, 2022

This topic describes Google Chrome settings required by TestComplete for automated web testing. Make sure to configure Chrome in this way on all computers where you are going to record and run tests.

If you use multiple user accounts for testing purposes on your computer, make sure all account-specific browser options are set for each account.

Install and configure the SmartBear Test Extension

The SmartBear Test Extension provides support for recording and playing back web tests in Chrome. This extension is installed and enabled automatically when you install TestComplete.

To verify that the extension is installed and enabled, look at the browser navigation bar — you should see the TestComplete icon there.

SmartBear Test Extension icon in Chrome

If the icon does not appear, navigate to chrome://extensions and make sure that SmartBear Test Extension is enabled. If the extension is not listed, install it manually.

Note: If the browser was running during TestComplete installation, you may need to reload web pages that have been opened in it for the test engine to be able to access them.

To test local pages (file://...) or pages in incognito mode:

  1. From the Chrome menu, select More Tools and then select Extensions.

    – or –

    Type chrome://extensions in the Chrome Address bar.

  2. Locate SmartBear Test Extension in the list and make sure that it is enabled.

  3. To test web pages opened from the local file system (their URLs start with the file:// prefix), select the Allow access to file URLs option of the extension.

  4. To test web pages during private browsing, select the Allow in incognito option.

  5. Restart the browser to apply the changes.

Command-line arguments

Chrome has a variety of command-line arguments. In general, none of them is required by TestComplete. However, depending on your test specifics, you may need to specify some of them to run automated tests:

Command-Line Argument Description
--disable-hang-monitor Disables the Chrome hang monitor to prevent it from considering the SmartBear Test Extension unresponsive during long test runs.

This argument is required to run tests that work for 10 minutes or longer. You may omit it for shorter tests.

--allow-file-access-from-files Enables testing of local pages (file://...) that use framesets displaying other local pages. Specify this argument to test HTML files that reside on your local computer.
--disable-web-security Enables testing of web pages that use cross-origin framesets, for example, iframe elements that load data from a source other than the tested page’s original source.

Requires the --user-data-dir and --disable-site-isolation-trials arguments to be specified.

--user-data-dir=<ProfilePath> Specifies a custom folder for storing user profile data.
--disable-site-isolation-trials Allows setting up Chrome security.
--disable-renderer-accessibility Disables creating MSAA/UIA web page objects.

Use this argument to improve playback performance, especially for testing pages with a large number of objects.

When the browser is launched in any of the ways described in the Launching Browsers topic, TestComplete automatically uses the --disable-hang-monitor switch for it. To specify other switches, use the Browsers.Item(…).RunOptions property.

If you launch the browser manually, you can specify the needed switches in the shortcut parameters:

  1. Right-click the shortcut and select Properties from the context menu.

  2. Switch to the Shortcut tab.

  3. Append --disable-hang-monitor and other needed switches (separated by spaces) to the Target value.

Chrome settings

Required settings

TestComplete requires that JavaScript execution be enabled in Chrome to identify web page elements. To enable JavaScript:

  1. Navigate to chrome://settings/content.

  2. In the JavaScript section, select Allow all sites to run JavaScript.

If your tested web application uses HTML pop-ups, disable the pop-up blocker in Chrome:

  1. Navigate to chrome://settings/content.

  2. In the Pop-ups section, select Allow all sites to show pop-ups.

Alternatively, if you prefer to have the pop-up blocker enabled, you can add your tested web application to the exceptions list. To do that, click Manage exceptions and use the subsequent Pop-up Exceptions page.

Disabling automatic updates

New versions of Chrome are released frequently. If the browser auto-update feature is enabled, it can automatically upgrade Chrome to a version that is not yet supported by TestComplete.

To avoid this, we recommended that you disable the browser’s auto-update feature on the test machine and install the latest browser version that is supported by your version of TestComplete manually.

To disable the auto-update feature:

  1. Use the Google Update ADM template as described on the Google Update for Enterprise web page and set the Administrative Templates > Google > Google Update > Applications > Google Chrome > Update policy override property to "Manual updates only" or to "Updates disabled".

  2. Locate or create the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\UpdateDefault registry value (REG_DWORD) and set it to "0".

  3. Remove or rename the <Program Files>\Google\Update folder.

To learn which Chrome versions are supported by TestComplete, go to the Google Chrome Patches page.

Disabling third-party injection blocking

The ThirdPartyBlockingEnabled security policy prevents injecting third-party modules into Chrome processes. The policy is enabled by default. This may prevent TestComplete from recording and simulating user actions on the Open File and Save File dialogs called from Chrome.

To avoid possible issues, we recommend that you disable the policy:

  1. On your computer, open the Registry editor. To do this, click the Start or Windows button, click Run, type regedit, and press Enter.

  2. In the Registry editor, locate the following key:

    Software\Policies\Google\Chrome

    If this key does not exist, create it.

  3. Make sure the ThirdPartyBlockingEnabled value of the key is set to false (0).

    If the value does not exist, create the DWORD value ThirdPartyBlockingEnabled and set it to 0.

If your Google Chrome browser settings are managed via group policies, ask your system administrator to update the policies to disable the ThirdPartyBlockingEnabled policy.

To learn more about policies, see chromeenterprise.google/policies.

Disabling unnecessary extensions

Some extensions may cause unexpected behavior of the browser, or even modify network traffic, which does not allow you to perform automated web testing. So, we recommended that you disable all third-party extensions except for SmartBear Test Extension and the extensions required for testing.

To disable extensions:

  1. From the Chrome menu, select Settings and then select Extensions on the left.

  2. Clear the Enabled check box next to the extensions you do not need.

For detailed instructions, see http://support.google.com/chrome/bin/answer.py?hl=en&answer=187443.

Chrome accounts

If you use several accounts in Chrome, do one of the following:

  • Log out of all accounts except for the one you will use for testing.

– or –

  • Disable the SmartBear Test Extension for all accounts except for the one you will use for testing.

Additional recommended settings

We also recommend that you configure Chrome as described below. While this is not required for automated testing, this may prevent unexpected browser behavior during test recording and test runs and improve Chrome performance:

  1. From Chrome’s main menu, select Settings.

    – or –

    Navigate to the chrome://settings page.

  2. On the Basics page:

    • Set On startup to Open the home page.

    • In Home page, select Open this page: and enter about:blank.

    Using a blank home page will prevent capturing of superfluous web pages during test recording and improves the browser startup performance.

  3. On the Personal Stuff page:

    • Set the Passwords option to Never save passwords.

    • Uncheck Enable Autofill to fill out web forms in a single click.

    This will prevent unexpected behavior when filling forms during test recording and test runs.

See Also

Preparing Web Browsers
About SmartBear Test Extension
Preparing CEF-Based Applications for Testing by Using Script Injection (Legacy)
Considerations for Web Testing
Classic Web Testing
Requirements for Web Testing
Possible Issues With Web Testing

Highlight search results