Web Testing with Firefox

Applies to TestComplete 15.78, last modified on October 24, 2025

This topic describes important considerations for automated web testing in the Firefox browser. Due to browser security restrictions and recent updates that rely heavily on Puppeteer, the process to record and play back tests has changed slightly.

Running the browser

Due to browser security restrictions, you cannot start Firefox directly through its executable when recording tests in TestComplete. Instead, you must use a driver.

To simplify this process, a dedicated executable named tcFirefoxRunner.exe is available next to the TestComplete executable. This executable launches Firefox in RemoteAgent mode, enabling programmatic control, and initiates the required driver so TestComplete can communicate with the browser.

In RemoteAgent mode, Firefox runs with temporary profiles. This means cookies, history, and other persisted user data are cleared after the browser closes. As a result, cookie consent banners and login prompts may appear every time you restart Firefox.

To start recording tests in Firefox, follow these steps:

View instructions

Additional limitations

  • Only one Firefox instance can be active during test recording or playback.

  • To close browser tabs, use the following script temporarily:

    Sys.Browser("firefox").Page("http://your-page-url.org").Close();

  • TestComplete uses the WebSockets protocol (localhost) to communicate with the browser. It starts with port 8080 and continues checking sequential ports if the default is in use. If WebSockets are disabled, communication fails and testing is not possible.

  • To confirm a dialog box, use the script:

    Sys.Browser("firefox").Page("http://your-page-url.org").ConfirmAlertDialogOK();

  • To cancel a confirmation dialog, use:

    Sys.Browser("firefox").Page("http://your-page-url.org").ConfirmDialogCancel();

Accessing Extended JS/HTML Properties

To retrieve specific HTML or JavaScript properties in your test, use scripting. Full object-based access will be restored in a future update.

Use the following sample to get the number of columns in the first table on a page:

function GetNumberOfColumnsInTheFirstTable() {
 var numberOfColumns = Sys.Browser("firefox").Page("https://your-page-url.org").Eval(" \
 (function() { \
  var table = document.getElementsByTagName('table')[0]; \
  var headerRow = table.rows[0]; \
  var numberOfColumns = headerRow.cells.length; \
  return numberOfColumns; \
 })(); \
 ");
 Log.Message("numberOfColumns=" + numberOfColumns);
}

The Eval function executes the provided string as a client-side script in the context of the web page, similar to using a browser’s developer console.

See Also

Preparing Web Browsers
Classic Web Testing
Requirements for Web Testing

Highlight search results