Reputation: 51
Does anyone encountered this type of error when you run laravel 5.6 dusk
ERRor Log in the Terminal:
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["--disable-gpu","--headless"]}}}
Failed to connect to localhost port 9515: Connection refused
Upvotes: 4
Views: 6353
Reputation: 819
This error is sometimes not really transparent. I was having this issue too and thought it was related to a bad Chromedriver installation or something regarding the driver, however, it turned out it was caused by the wrong logic of one of my classes that were responsible for loading and processing the JSON data, some finding in the database and turning data into Laravel collections.
I was loading malformed JSON and my checks for JSON sanity were false positive, so my method thought JSON data was ok, while it contained empty arrays []
or exception messages from the other server. So for anyone having the same problem and tried dealing with the Chrome driver and it didn't work, I would suggest taking the hard path and starting digging into your method's logic a little bit more and checking if the outputs of functions and methods are ok with dd(...)
.
Upvotes: 0
Reputation: 86
Make sure your chrome-driver is executable and running. Try following command
./vendor/laravel/dusk/bin/chromedriver-linux --port=8888
You should see following output
Starting ChromeDriver 2.x.x (649f9b868f6783ec9de71c123212b908bf3b232e) on port 8888 Only local connections are allowed.
Upvotes: 7