Closed muhammadsaeedparacha closed 2 weeks ago
What's your Chrome version?
This might be the same problem as mine here. My full error message is:
Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--disable-search-engine-choice-screen"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--disable-search-engine-choice-screen"]}}}
Failed to connect to localhost port 9515 after 0 ms: Could not connect to server
My Chrome version is the newest: Version 128.0.6613.85
You should be able to fix the issue by updating the following line from tests/DuskTestCase.php
:
/**
* Prepare for Dusk test execution.
*/
#[BeforeClass]
public static function prepare(): void
{
if (! static::runningInSail()) {
- static::startChromeDriver([]);
+ static::startChromeDriver(['--port=9515']);
}
}
You should be able to fix the issue by updating the following line from
tests/DuskTestCase.php
:/** * Prepare for Dusk test execution. */ #[BeforeClass] public static function prepare(): void { if (! static::runningInSail()) { - static::startChromeDriver([]); + static::startChromeDriver(['--port=9515']); } }
This did resolve the issue for me.
Dusk Version
8.2.4
Laravel Version
11.21.0
PHP Version
8.3
PHPUnit Version
11.1.3
Database Driver & Version
No response
Description
Fails to start with latest chrome version, Chrome 128
Tests\Browser\ExampleTest > basic example WebDriverCurlException
Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu"]}}}
Steps To Reproduce
Fresh Laravel Installation Update Chrome to 128
php artisan dusk
fails