Laravel Dusk on Centos: Failed connect to localhost:9515; Connection refused - laravel

OK, today is the day. I finally started (again) to use TDD.
I notice that this thing called Dusk has appeared. Great, browser testing.
The only problem is that I get this:
Failed connect to localhost:9515; Connection refused
I did chmod 777 on the chromedriver files and still get the error.
My dev server is a Centos vm. Is this the problem?
Edit:
I think I am making some progress:
yum install GConf2
Now I get:
cannot find Chrome binary
EDIT
I am back on this now.
php artisan dusk gives me:
Facebook\WebDriver\Exception\UnknownServerException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 3.10.0-327.3.1.el7.x86_64 x86_64)
If I do this:
./vendor/laravel/dusk/bin/chromedriver-linux
I get this:
Starting ChromeDriver 2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f) on port 9515
Only local connections are allowed.
Any ideas?
Mick

Try running: ./vendor/laravel/dusk/bin/chrome-linux
If you see:
Starting ChromeDriver 2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f) on port 9515 (or whatever port you are using)
Only local connections are allowed. Then it is working. I also had to install the google-chrome binary:
How to install 64-bit Google Chrome on 64-bit RHEL/CentOS 7
The other thing to install is Xvfb. Then you can run this command in a new terminal: Xvfb :0 -screen 0 1280x960x24 &
This is supposed to be the way to run this. I however, have not been able to get this to work. I am hoping someone can also add some input here.
Update:
I got his to work. Make sure that nothing is running as root.

Related

Error while installing WSL for windows 11

when i run the command on administrator settings on my windows 11
wsl --install
it shows me the following error
a connection with the server could not be established
I searched youtube too for the fixes but none worked
Hi I was having same error. I am Indian using Jio Fiber. I connected to VPN to solve the error. It seems that Jio prevents connection to certain url such as https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json which are needed for wsl linux installation. You can check by trying to open above link in chrome and running network diagnostics. Basically the above url gets called at the end when you do wsl --install.
I tried to install it with VPN and it works. Using VPN may work for you.

Laravel Brower Test (Dusk) error on MacOS (Docker): Failed to connect on localhost port 9515: connection refused

I just installed Laravel's Dusk to add browser tests. However, when I run a test, I get a Failed to connect on localhost port 9515: connection refused error.
I checked online and it seems like a lot of people are having the same issue. I came across few solutions e.g. this but it seems like they are all for Windows and Homestead whilst I am running my project on MacOS and Docker.
I did try to follow the solution but I found out sudo apt is not available for MacOS. I then installed Homebrew and tried to run the commands starting with brew instead of sudo apt but it responds saying no formula available for the name.
I would really appreciate it if you could recommend a solution or source I could look at. Thank you.
In case if someone else is having the same issue:
Basically, the issue was I was just following the Laravel Dusk Documentation without making any further configuration.
For the Docker environment, more configuration has to be done such as adding a Selenium container to allow the browser tests to run.
Checkout Jake Harris's 7 steps to running Laravel Dusk 3.0 tests in Docker environments to do this.
Thank you.

unable to connect to chromedriver 127.0.0.1:9515. Amazon Linux AMI

I am setting up my selenium-webdriver tests with Linux and working on automating my tests with Cron Jobs. When running my script I am receiving this error
Selenium::WebDriver::Error::WebDriverError:
unable to connect to chromedriver 127.0.0.1:9515
which chromedriver returns:
/usr/bin/chromedriver
and which google-chrome-stable returns:
/usr/bin/google-chrome-stable
I thought that the error was related to not having Chrome installed yet, so I did that, but has not seemed to fix my issue.
How can I work through this?
Thanks!
Firstly, locate your chromedriver (possibly /usr/bin) and check your dependencies:
ldd /usr/bin/chromedriver
It is likely you'll be missing at least libgconf-2
If this is the case, try this to resolve: https://forums.aws.amazon.com/thread.jspa?threadID=229187

Install chromedriver using a remote host

I deployed my application using Ruby, Sinatra and Redis DataBase, on my ubuntu remote host named Scaleway.
In this way, i've install all what i need, and i can acces to my application. So when i want to use my script, who use Watir gem (selenium), it's always show me this error :
Selenium::WebDriver::Error::WebDriverError at /show_result
unable to connect to chromedriver 127.0.0.1:9515
I know that i need Xvfb (who is installed), the headless gem (that i implemented in my code), and chromedriver that i installed by the same way that i installed it on my local machine.
On my local machine, it works perfectly, but in my remote host, it show me this error above.
Did you know how to fix this problem ? How did you install Chromedriver so that my program recognizes it ?
Did you run the watir command using xvfb with something like this
xvfb-run <here is your command>
Also Chromedriver should place properly so it can be access anywhere, usually I put chromedriver at /usr/bin/ or /usr/sbin/

How can I get Xdebug working in PHPStorm with Laravel?

I'm following the Laracast for PHPStorm and setting up xdebug. When I run xdebug on a controller in my laravel project, it prompts me to install a chrome extension. If I install said chrome extension, I just get a browser window stating Fatal Error: Class 'BaseController' not found . Jeff doesn't mention this extension, nor does anyone in the comments. As a result, I'm not seeing anything in the debugger except "Connected to JetBrains Chrome Extension". What gives? I followed the tutorial precisely.
I follow this jetbrains guide plus proxying tunneling the 9000 port.
For me Proxying / Tunneling the Debugger Connection do the trick.
I need to bring port 9000 to my local machine like this:
ssh -R 9000:localhost:9000 vagrant#192.168.50.10 //or wathever ip of you homestead
instead of run homestead sh for login to my homestead machine.
I hope works for you.

Resources