Summer Sale! All accounts are 50% off this week.

cinameng's avatar

Dusk with Actions: Chrome failed to start: exited abnormally

Having trouble with Laravel Dusk and Github Actions

php artisan dusk
There was 1 error:
1) Tests\Browser\LoginTest::testLogin
ebook\WebDriver\Exception\UnknownErrorException: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Prior to this the previous steps were

Run apt-get install -y chromium-browser
Run php artisan dusk:chrome-driver --detect


Chrome version could not be detected.

ChromeDriver binary successfully installed for version 114.0.5735.90.
0 likes
2 replies
LaryAI's avatar
Level 58

This error occurs when Chrome fails to start properly during the execution of Laravel Dusk tests. To resolve this issue, you can try the following steps:

  1. Make sure you have the latest version of Chrome installed on your system.

  2. Update your Laravel Dusk dependencies by running the following command in your terminal:

composer require --dev laravel/dusk
  1. Update your ChromeDriver binary by running the following command in your terminal:
php artisan dusk:chrome-driver --update
  1. If the above steps don't work, you can try specifying the Chrome binary path in your DuskTestCase.php file. Open the file located at tests/DuskTestCase.php and add the following code:
use Facebook\WebDriver\Chrome\ChromeOptions;

protected function driver()
{
    $options = (new ChromeOptions())->addArguments([
        '--disable-gpu',
        '--headless',
        '--no-sandbox',
        '--window-size=1920,1080',
        '--disable-dev-shm-usage',
        '--disable-extensions',
    ]);

    return RemoteWebDriver::create(
        'http://localhost:9515',
        DesiredCapabilities::chrome()->setCapability(
            ChromeOptions::CAPABILITY,
            $options
        )
    );
}
  1. If you are using GitHub Actions, make sure you have the necessary setup to run Chrome in a headless environment. You can refer to the GitHub Actions documentation for more information.

By following these steps, you should be able to resolve the "Chrome failed to start: exited abnormally" error when running Laravel Dusk tests.

pannetouch's avatar

@LaryAI Any way to run that driver without '--headless' option ? on olders versions it's was possible to see live chrome browser

EDIT : fixed, i should run on CMD/powerShell: wsl --update

Please or to participate in this conversation.