This error occurs when Laravel Dusk is unable to locate the Chrome binary. One solution is to specify the path to the Chrome binary in the Dusk configuration file.
To do this, create a new file named dusk.php in the tests directory and add the following code:
<?php
use Facebook\WebDriver\Chrome\ChromeOptions;
$options = (new ChromeOptions())->addArguments([
'--disable-gpu',
'--headless',
'--no-sandbox',
]);
$options->setBinary('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome');
return [
'driver' => 'chrome',
'chromeOptions' => $options,
];
Make sure to replace the path to the Chrome binary with the correct path on your machine.
Alternatively, you can try installing the ChromeDriver binary using Homebrew:
brew install chromedriver
Then, run the following command to update the Dusk configuration:
php artisan dusk:chrome-driver
If neither of these solutions work, try updating Laravel Dusk to the latest version.