Testacular in Windows 64-bit cannot start browser

I'm trying to test an AngularJS app with Testacular in Windows 8 64-bit.

When I run the "yeoman test" or "testacular start" command I get an error saying; "The system cannot find the path specified":

C:\Users\me\Dropbox\GitHub\Studentportalen\studentportalen>yeoman test

Running "test" task
info: Testacular server started at http://localhost:8080/
info (launcher): Starting browser PhantomJS
warn (watcher): Pattern "C:/Users/me/Dropbox/GitHub/Studentportalen/st
udentportalen/test/mock/**/*.js" does not match any file.
error (launcher): Cannot start PhantomJS
    CreateProcessW: The system cannot find the path specified.

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

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

info: Disconnecting all browsers
<WARN> Command failed:  Use --force to continue. </WARN>

Aborted due to warnings.

I've tried setting Testacular to use Chrome instead of PhantomJS, but get the same error. So PhantomJS is not the problem.

I've heard it happens because Node.js doesn't like 64-bit Windows (?). A workaround could be to set up a 32-bit VM for testing, but that is obviously not optimal.

Is there any solution to this problem?

I just came across this problem too. I found that to run the Chrome version I had to create a system variable called "CHROME_BIN" pointing at my chrome.exe file. So I just tried creating a "PHANTOMJS_BIN" variable that pointed to my phantom.cmd file and "hey presto" it worked :)

In my experience, testacular/Node.js work fine in 64-bit Windows. The problem is that the launch configuration files for most browsers use the 'ProgramFiles' environment variable in the browser's file path. On 64-bit Windows, this points to 'Program Files' instead of 'Program Files (x86)' where most browsers are installed.

There are two solutions:

  • as johngeorgewright suggests, use [BROWSER]_BIN environment variables that point to the correct locations: Testacular Browser Configuration
  • Change the launch configuration files. These plain JS files are located in the sub-directory 'lib\launchers' of the testacular installation.