jasmine / jasmine-browser-runner

Serve and run your Jasmine specs in a browser
50 stars 25 forks source link

Unable to find the Google Chrome binary - macOS Ventura 13.5 #39

Closed evilcins closed 1 year ago

evilcins commented 1 year ago

With Chrome + chromedriver version 115 (and earlier I presume) on Ventura 13.5 - this has been repeated by multiple other users with the same environment. The runSpecs command fails with the following trace:

Running tests in the browser...
WebDriverError: unknown error: cannot find Chrome binary
    at Object.throwDecodedError (/Users/username/rails/project/node_modules/selenium-webdriver/lib/error.js:524:15)
    at parseHttpResponse (/Users/username/rails/project/node_modules/selenium-webdriver/lib/http.js:601:13)
    at Executor.execute (/Users/username/rails/project/node_modules/selenium-webdriver/lib/http.js:529:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  remoteStacktrace: '0   chromedriver                        0x0000000104616924 chromedriver + 4303140\n' +
    '1   chromedriver                        0x000000010460f050 chromedriver + 4272208\n' +
    '2   chromedriver                        0x0000000104243328 chromedriver + 291624\n' +
    '3   chromedriver                        0x000000010426ba7c chromedriver + 457340\n' +
    '4   chromedriver                        0x000000010426affc chromedriver + 454652\n' +
    '5   chromedriver                        0x00000001042aa040 chromedriver + 712768\n' +
    '6   chromedriver                        0x00000001042a980c chromedriver + 710668\n' +
    '7   chromedriver                        0x00000001042748d4 chromedriver + 493780\n' +
    '8   chromedriver                        0x000000010427571c chromedriver + 497436\n' +
    '9   chromedriver                        0x00000001045d77dc chromedriver + 4044764\n' +
    '10  chromedriver                        0x00000001045dbd20 chromedriver + 4062496\n' +
    '11  chromedriver                        0x00000001045e1f40 chromedriver + 4087616\n' +
    '12  chromedriver                        0x00000001045dc824 chromedriver + 4065316\n' +
    '13  chromedriver                        0x00000001045b4d1c chromedriver + 3902748\n' +
    '14  chromedriver                        0x00000001045f8414 chromedriver + 4178964\n' +
    '15  chromedriver                        0x00000001045f856c chromedriver + 4179308\n' +
    '16  chromedriver                        0x0000000104608830 chromedriver + 4245552\n' +
    '17  libsystem_pthread.dylib             0x00000001aab7bfa8 _pthread_start + 148\n' +
    '18  libsystem_pthread.dylib             0x00000001aab76da0 thread_start + 8\n'
}
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Other browsers work fine.

I've tracked it down to here:

return webdriverBuilder
        .forBrowser('chrome')
        .withCapabilities(caps)
        .build();

If I pass chrome options like so, it works as expected:

return webdriverBuilder
        .forBrowser('chrome')
        .setChromeOptions(new chrome.Options().setChromeBinaryPath('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome').headless())
        .withCapabilities(caps)
        .build();

I've tried reinstalling chrome, to no avail.

sgravrock commented 1 year ago

Some context:

https://github.com/SeleniumHQ/selenium/issues/12381 https://github.com/GoogleChromeLabs/chrome-for-testing/issues/30

Looks like a Chromedriver bug that will be worked around in the next release of Selenium.

fabiokr commented 1 year ago

@sgravrock It looks like Selenium 4.11 has been released https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/CHANGES.md#v4110

sgravrock commented 1 year ago

I've confirmed that upgrading either selenium-webdriver or chromedriver to the latest version fixes this.