Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Dusk error: Failed to connect to localhost port 9515: Connection refused

As the title says, I've go a clean install of Laravel 5.4 and the latest Homestead (1.0.1). However, when I run a simple Dusk test case I get the following error:

Failed to connect to localhost port 9515: Connection refused

Anyone know how to deal with this? I tried changing the port to something else such as 8888 to no avail.

EDIT: I've been able to dig a little deeper and found out that the chromedriver executable was not actually executable (chmod). Now that I've fixed that I get this error when I manually try to run it.

./chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

like image 811
Nick Avatar asked Feb 04 '17 12:02

Nick


2 Answers

For those looking for a solution on Mac, I've just had to restart Chrome. Yes, Chrome, the browser. It seems it'd a pending update (it said that in the upper right corner).

Restarting it, and later chromedriver, make everything went fine

like image 67
David Fernández Rafael Avatar answered Sep 25 '22 14:09

David Fernández Rafael


I had this issue today and the solution is on Laracasts.

Here's a copy.

# makes sure all your repos are up to date sudo apt-get update  # chrome dependencies I think sudo apt-get -y install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4  # chromium is what I had success with on Codeship, so seemed a good option sudo apt-get install chromium-browser  # XVFB for headless applications sudo apt-get -y install xvfb gtk2-engines-pixbuf  # fonts for the browser sudo apt-get -y install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base         xfonts-scalable  # support for screenshot capturing sudo apt-get -y install imagemagick x11-apps  # Once all this has run through, you need to fire up xvfb on your homestead box. If you’re planning to # do this on a regular basis, you’ll want to get this setup on boot, but for the sake of testing things out: Xvfb -ac :0 -screen 0 1280x1024x16 & 
like image 32
SimonDepelchin Avatar answered Sep 24 '22 14:09

SimonDepelchin