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:
Opening Hyperlinks with Firefox
To open hyperlinks in Firefox during your test routine, for example, from buttons in your custom GUI applications, set Firefox as the default browser and ensure it opens in RemoteAgent mode.
This setting requires modifying the Windows Registry because it cannot be changed through the Control Panel. Run the following .REG file to update the appropriate registry key:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell\open\command]
@="\"C:\\Program Files (x86)\\SmartBear\\TestComplete 15\\x64\\Bin\\tcFirefoxRunner.exe\" \"%1\""
| Note: | This change affects all HTTP and HTTPS links system-wide, including those opened from emails and chat applications like Slack. |
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

Running the browser
View instructions