Testacular doesn't launch chrome browser Testacular doesn't launch chrome browser google-chrome google-chrome

Testacular doesn't launch chrome browser


It could be that the fix Vojta pointed to above (setting the window to maximize) solved your problem, but it didn't solve it for me now, 4 months later.

My first advice is to find out exactly what the launcher is using to try and start Chrome:

karma start <yourconfig> --log-level debug

On my system, I found two problems with Karma(Testacular) version 0.8.4, either of which was enough to keep Chrome from opening on my Windows 7 64 with Chrome 26:

1) Getting the command line shorter & pointed at Chrome

First, there's something about the launcher command which, in the context of it being called, should work but doesn't. It works if I paste it in to a console myself, but not when Karma runs it. Perhaps it's just a bit too long.

To fix this

  1. Put Chrome onto your Windows PATH environment variable.
  2. Set the CHROME_BIN Windows Environment variable to just "chrome.exe".

Now the command line will start with just chrome.exe, rather than the full path to it. Note, this also solves another problem (pointed to by Joe below), that the default path for Chrome that Karama uses points somewhere in your user directory, not in your Program Files. So by setting this Environment variable, you cause Karma to use it instead.

2) Fixing the user-data-dir

Next, through try-and-error, I found that the launcher command uses an equals sign after one of its parameters, which also makes Chrome not start correctly. I can't explain why. But the fix is easy:

  1. Find the chrome.js file and change

'--user-data-dir=' + this._tempDir,

to

'--user-data-dir ' + this._tempDir,

If this helps other people, let me know, I'll submit a pull request. But at the moment, I'm in that "no one else is mentioning this, so maybe it's just something weird about my system" mode...