Dusk: cannot find Chrome binary

Created on 16 Oct 2019  路  9Comments  路  Source: laravel/dusk

  • Dusk Version: 5.5.2
  • Laravel Version: 6.3.0
  • PHP Version: 7.3.10
  • Database Driver & Version: Mysql 8.0.18

Description:

Dusk is installed.

The chrome driver looks like it's installed

php artisan dusk:chrome-driver
ChromeDriver binary successfully installed for version 77.0.3865.40.

Here is the error output
```
php artisan dusk
PHPUnit 8.4.1 by Sebastian Bergmann and contributors.

E 1 / 1 (100%)

Time: 935 ms, Memory: 18.00 MB

There was 1 error:

1) TestsBrowser\ExampleTest::testLoginPage
Facebook\WebDriver\Exception\UnknownServerException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442}),platform=Linux 4.19.72-microsoft-standard x86_64)

/var/www/cyndash/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:114
/var/www/cyndash/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:331
/var/www/cyndash/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:144
/var/www/cyndash/tests/DuskTestCase.php:42
/var/www/cyndash/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:192
/var/www/cyndash/vendor/laravel/framework/src/Illuminate/Support/helpers.php:393
/var/www/cyndash/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:193
/var/www/cyndash/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:93
/var/www/cyndash/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:64
/var/www/cyndash/tests/Browser/ExampleTest.php:21

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

Here is the test function

public function testLoginPage()
{
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->assertSee(env('APP_NAME'));
});
}

Also the baniray can be launched manually

./vendor/laravel/dusk/bin/chromedriver-linux
Starting ChromeDriver 77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442}) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
```

Steps To Reproduce:

This is a clean install of dusk running on WSL Ubuntu 18.04.

What do I need to check ?
I'm trying to test Laravel Nova :)

Most helpful comment

I just ran into this problem again too after creating a new VirtualBox. I think the docs would benefit from mentioning sudo apt-get install chromium-browser. Thanks.

All 9 comments

The ChromeDriver is installed but the Chrome browser isn't. Did you install it?

Problem solved. Thanks @staudenmeir

I just feel dumb :p. Maybe a note could be added in the documentation.

@Gil-1 there is:

By default, Dusk uses Google Chrome and a standalone ChromeDriver installation to run your browser tests.

https://laravel.com/docs/6.x/dusk#using-other-browsers

I just ran into this problem again too after creating a new VirtualBox. I think the docs would benefit from mentioning sudo apt-get install chromium-browser. Thanks.

I just ran into this problem again too after creating a new VirtualBox. I think the docs would benefit from mentioning sudo apt-get install chromium-browser. Thanks.

Thanks. It's working now...

Running sudo apt-get install chromium-browser on an fresh last version of Homestead gives me these errors:

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_80.0.3987.163-0ubuntu0.18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-browser_80.0.3987.163-0ubuntu0.18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-browser-l10n_80.0.3987.163-0ubuntu0.18.04.1_all.deb  404  Not Found [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

To fix it I had to run:
sudo apt-get update

and then re-run sudo apt-get install chromium-browser, this time without issues.

@ryancwalsh thanks!

@decadence Glad it helped :-)

one two terminal tabs:
First: php artisan serve
Second: php artisan dusk

Note:// Make sure you install Chrome and the driver by php artisan dusk:chrome-driver --detect.

happy coding

Was this page helpful?
0 / 5 - 0 ratings

Related issues

godruoyi picture godruoyi  路  6Comments

ahtinurme picture ahtinurme  路  6Comments

dmitryuk picture dmitryuk  路  5Comments

guirociozanini picture guirociozanini  路  6Comments

subathanikaikumaran picture subathanikaikumaran  路  3Comments