Reputation: 99
When I run testacular with 'browsers' set to "Firefox", a new firefox browser opens. I can open the console in there and see my 'console.log' messages etc...
When I run testacular with 'browsers' set to "Chrome" or "ChromeCanary", no new browser opens. The tests run correctly, but I can't see the console (because I've got no browser).
I have CHROME_PATH set in my windows settings (and CHROME_CANARY_PATH too), I get no error messages regarding browser startup and as I say, my tests work correctly.
Any ideas why my browser doesn't open??
Answered by Vojta : There is a bug on Chrome windows: http://code.google.com/p/chromium/issues/detail?id=151836 Chrome is running, but it does not show the UI.
Upvotes: 4
Views: 2167
Reputation: 1784
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:
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
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.
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:
'--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...
Upvotes: 3