Support the ongoing development of Laravel.io →
Dusk Testing Configuration

Hi everyone, I'm using a vagrant box (not homestead) to host our laravel project. I'm trying to use Laravel Dusk to do some automated browser testing using the chromium browser but it isn't working right.

When I run php artisan dusk the command just hangs for a while and eventually dies with this output:

There was 1 error:

1) Tests\Browser\FreeAdvertTest::testAuctionUpsellPageTextAreCorrect
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"binary":"/usr/bin/chromium-browser","args":["--disable-gpu","--headless","--allow-insecure-localhost","--no-sandbox","--disable-dev-shm-usage","--window-size=1920,2080","--profile-directory=Default","--user-data-dir=dusk"]},"acceptInsecureCerts":true}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"/usr/bin/chromium-browser","args":["--disable-gpu","--headless","--allow-insecure-localhost","--no-sandbox","--disable-dev-shm-usage","--window-size=1920,2080","--profile-directory=Default","--user-data-dir=dusk"]},"acceptInsecureCerts":true}}

Operation timed out after 10001 milliseconds with 0 bytes received

Here is my DuskTestCase.php driver setup:

protected function driver(): RemoteWebDriver
    {
        $options = (new ChromeOptions())
            ->setBinary('/usr/bin/chromium-browser')
            ->addArguments([
            '--disable-gpu',
            '--headless',
            '--allow-insecure-localhost',
            '--no-sandbox',
            '--disable-dev-shm-usage',
            '--window-size=1920,2080',
            '--profile-directory=Default',
            '--user-data-dir=dusk',
            ]);

        return RemoteWebDriver::create(
            'http://localhost:9515',
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY,
                $options
            )->setCapability('acceptInsecureCerts', true),
            10000,
            10000
        );
    }

I've done a fair bit of research and I'm still lost. Here's what I've tried:

  • Checking chrome driver and chromium are executable
  • Checking chrome driver and chromium are the same version
  • Installing with php artisan dusk:chrome-driver --detect
  • Uninstalling and reinstalling chromium and chrome driver
  • Changing driver urls and ports

I briefly installed google chrome and that worked great, but other members of my team require chromium instead of chrome, so I'm back where I started. Is someone able to provide any pointers on where to look?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.