Selenium gives “unknown error: cannot find Chrome binary” when running chrome driver on Ubuntu

前端 未结 4 660
不思量自难忘°
不思量自难忘° 2020-12-29 10:44

I am trying to run selenium [java] tests using chrome driver on Latest ubuntu.[16.04]

I am getting the following error/exception. As an experiment, I replaced Chrome

4条回答
  •  一整个雨季
    2020-12-29 11:23

    You may install Chrome through NPM:

    https://www.npmjs.com/package/chromium

    npm install chromium

    Then, map your chrome binary:

    const chromium = require('chromium');
    
    capabilities: [
        {
            browserName: 'chrome',
            'goog:chromeOptions': {
                binary: chromium.path
            },
        },
    ],
    

提交回复
热议问题