Fix Laravel Dusk Exception timed out after 30001 milliseconds.

If you are using Laravel Dusk and getting the following issue in running your dusk tests.

Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"w3c":false,"binary":""}}}

Connection timed out after 30001 milliseconds

These are the possible reasons.

1. The website you are testing on is slow and is responding after 30 seconds. (unlikely if you are working on a localhost website)
2. Chrome Driver version is mismatched with the browser (Run command php artisan dusk:chrome-driver to update your chrome driver)
3. Dusk is not able to connect to chrome driver port 9515 (Because it’s already in use)
Solution:
If you are on Linux Run the following command to check which process id is using the 9515 port.

netstat -tulpn

Once you have the process-id run the following command to kill the process

kill -9 process-id

Replace process-id with the actual process id which you get in the netstat command results.

Related Articles

Leave a reply:

Your email address will not be published.

Site Footer