TeamCity build agents and FireWatir
We have had some issues lately getting our automated acceptance tests running in TeamCity on Firefox.
Our failing tests could open browser windows, but not interact with them — the same behaviour exhibited when the JSSH plugin is missing. And the error reported in TeamCity is like:
Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option (Watir::Exception::UnableToStartJSShException)
This was puzzling because we knew we had installed JSSH.
The problem amounts to ensuring the Firefox JSSH extension is enabled for the correct account.
Build agents, user accounts and desktop (GUI) interaction
Only when Local System Account is selected can you also select the Allow service to interact with the desktop option. The “this account” method does not even allow selection of the checkbox (watch carefully, the checkbox is unchecked when you press apply).
Running without GUI does not prevent these types of things happening — they’re just not painted on the screen — so to diagnose issues like these it’s preferable to allow interaction with desktop.
This means running build agents as Local System account.
$ "C:\Program Files\Mozilla Firefox\firefox -install-global-extension 'path\to\extension'"
You can then run Team City Build Agent Service as Local System user and enable desktop interaction.
- [Windows Local System account] The LocalSystem account is a predefined local account used by the service control manager. This account is not recognized by the security subsystem, so you cannot specify its name in a call to the LookupAccountName function. It has extensive privileges on the local computer, and acts as the computer on the network.
- [Firefox command line options] Various command line options are be available to perform advanced, troubleshooting or system administration tasks. Installation into the application directory is possible from the command line, intended to be used by administrators on multi-user systems.