Karma: Cannot start Chrome

Created on 1 Dec 2012  路  19Comments  路  Source: karma-runner/karma

C:\foodme>scripts\test.bat
warn: Port 9876 in use
warn: Port 9100 in use
info: Testacular server started at http://localhost:9877/
info (launcher): Starting browser Chrome
info: To run via this server, use "testacular run --runner-port 9101"
error (launcher): Cannot start Chrome
        CreateProcessW: The system cannot find the path specified.

info (launcher): Trying to start Chrome again.
error (launcher): Cannot start Chrome
        CreateProcessW: The system cannot find the path specified.

info (launcher): Trying to start Chrome again.
error (launcher): Cannot start Chrome
        CreateProcessW: The system cannot find the path specified.

Chrome path is: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

support

Most helpful comment

Or use different OS :-D

All 19 comments

Try having a look at these instructions. https://github.com/vojtajina/testacular/wiki/Browsers

Or use different OS :-D

The above issue is for 64 bit windows machines. If you have Cygwin / installed the Git Bash utility from Github you should have the export command built in. Simply use:

export CHROME_BIN='C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'

and your set.

Vojta, several times, I've seen you offhandedly dismiss a posted issue based on a windows platform choice & testacular's failure to run on that platform. A lot of enterprises do used *nix + windows or windows only, why exclude them?

Thank you, Dignifiedquire & riffic33, your comments were helpful.

Vojta filed a bug against on a chrome + windows related issue here: http://code.google.com/p/chromium/issues/detail?id=151836 . "This breaks the Testacular test runner on Windows, as described above by Vota Jina (author of Testacular)."

Might be best to try FF/IE/etc instead until the problem is resolved.

@KevinOrtman Yes sadly there hasn't been any movement on this. There is another issue open for that #74. Please comment/star on the issue so it gets some traktion.

Done. Thanks.

@KevinOrtman Another thing. Could you try browser-launcher out on Windows? I'm looking for alternatives/better ways of launching the browsers and it would be great to know how well this works on Windows.

Initial results not looking too positive. Execution of 'launch.js' yielded the following output. I'm running Windows 7 x64 w/ 32 bit Chrome and node.I can poke around a bit with this to see if I can get better results.
Checking: google-chromeFetching version for google-chromeChecking: chromium-browserChecking: firefoxFetching version for firefoxChecking: phantomjsChecking: safariFetching version for safariChecking: ieFetching version for ieVersion for google-chromeVersion for safariVersion 9.0.8112.16421 for ieFetching path for ie 9.0.8112.16421 C:\Program Files (x86)\Internet Explorer\iexplore.exeVersion 17.0.1 (en-US) for firefoxFetching path for firefox 17.0.1 (en-US) undefinedfirefox -CreateProfile browser-launcher-ed3a9109exited with code 127: CreateProcessW: The system cannot find the file specified.

So I hacked the browser-launcher code a bit to work with my specific config (https://github.com/substack/browser-launcher/issues/7) and the chrome launch does work.

The version/path detection logic for windows is rather fragile but could be improved.

How's the logic for unix/os x? Does it look solid/usable?

@KevinOrtman I don't wanna exclude anyone, really. However, I work on this project mostly in my free time and the primary thing is our use case on AngularJS and some other Google projects. We don't use Windows at all (we test IE browsers but we don't run Testacular on Windows machines).

That said, if you wanna improve the integration with Windows, go for it! I'm happy to merge your pull requests or give you hints. There are already folks that helped with Windows integration a lot (@taichi, @Iristyle, @Dignifiedquire and others) and I really appreciate that. But I'm not gonna spend time fixing Windows issues.

I understand, Vojta & I'll help out where I can. @taichi, @Iristyle, @Dignifiedquire have all helped tons here, the chocolatey package (Irishstyle?) put together _really_ helped the install experience.

I was able to get chrome working out on Win7/64 after doing the following:
1) set CHROME_BIN per riffic33 advice
2) adding the '--start-maximized' flag to the chrome options. I submitted a pull request for this.
3) increase the timeout from 5000 ms to 10000 ms. At 5000 ms, timeouts occurred and the retry logic kicks in and eventually resolves after 2~3 tries.

That's great to hear. We should create a wiki page Windows Troubleshooting to collect all this info so people can find it.

I've added the suggest page here.
Feel free to add stuff that you encounter.

I haven't had the chance to dig deeper into browser-launcher but I think we will probably just use some ideas and integrate them in our current solution.

After numeros trials, I end up modifying the corresponding launcer for Chrome, located in my machine at: C:\Users\MyAccount\AppData\Roaming\npm\node_modules\karma\lib\launchers\Chrome.js :

ChromeBrowser.prototype = {
name: 'Chrome',

DEFAULT_CMD: {
linux: 'google-chrome',
darwin: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
win32: 'C:\Program\ Files\ (x86)\Google\Chrome\Application\chrome.exe'
},
ENV_CMD: 'CHROME_BIN'
};

@rcpacheco it's better if you just set env variable CHROME_BIN to correct path, because you will loose your changes once you update karma.

I just added an environment variable pointing directly to the exe file instead of the folder.
CHROME_BIN
C:\Program Files\Google\Chrome\Application\chrome.exe

@RyanQuackenbush thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schippie picture schippie  路  5Comments

ORESoftware picture ORESoftware  路  4Comments

anius picture anius  路  3Comments

TKTheTechie picture TKTheTechie  路  4Comments

charpour picture charpour  路  3Comments