Unable to connect to Firefox - selenium

I'm working on Selenium and I currently have a hub connected to two vms running linux with all the browsers.
I was able to launch browsers until suddenly it just stopped . Firefox or any of the other browsers don't launch. I get the following error.
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.
I am running Selenium-server-standalone 2.26 with firefox 16.0.2 .
Please help.

Try running this before you start your Selenium server:
export DISPLAY=:0

Related

Starting ChromeDriver 75.0.3770.90 (refs/branch-heads/3770#{#xxxx}) on port xxxxx Only local connections are allowed

While running simple selenium test in google chrome, got below error. (Windows 10)
Starting ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590####-refs/branch-heads/3770#{#XXXX}) on port XXXXX
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

Problems launch Serenity's test on Jenkins

I am trying to launch my serenity-Cucumber tests on a Jenkins server. Actually I'm stuck with a simple error when it launch ChromeDriver :
"IPv4 port not available. Exiting..."
My failed tests are simple : goes to a special url and verify if the url is the one expected
I'm running on maven 1.9.9 - cucumber 1.9.5 - serenity 1.9.9 - chromedriver 2.40 - jenkins 2.19.1
I run my project with command "clean verify"
I tried to set a proxy but it didn t change anything - and I tried to change chromeDriver's port without results
Is there someone who has already face this problem ?
Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 4013
Only local connections are allowed.
Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 9015
Only local connections are allowed.
IPv4 port not available. Exiting...

Testing Codeception on Gitlab CI with Selenium service

I'm trying to setup selenium standalone chrome service to test my Codeception suit.
I run chrome standalone as a service:
services:
- mysql:latest
- selenium/standalone-chrome:latest
And then I setup the connections for my Codeception test uses WebDriver with an extension for WordPress:
WPWebDriver:
url: 'http://localhost'
host: 'selenium__standalone-chrome'
browser: chrome
port: 4444
restart: true
wait: 2
adminUsername: admin
adminPassword: 1234
adminUrl: /wp-admin
All other tests run well but when it comes to the suite where I use Selenium it refuses to connect:
Time: 7.55 seconds, Memory: 16.00MB
There was 1 failure:
---------
1) SampleTestCept: Test if wp is working in selenium
Test tests/php/acceptance/SampleTestCept.php
Step See "Just another WordPress site"
Fail Failed asserting that on page /
--> This site can’t be reached
localhost refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
Reload
DETAILS
--> contains "this site can't be reached".
Scenario Steps:
2. $I->see("This site can't be reached") at tests/php/acceptance/SampleTestCept.php:6
1. $I->amOnPage("/") at tests/php/acceptance/SampleTestCept.php:4
Any ideas of what am I doing wrong?
Use environment variable HOSTNAME, to find gitlab runner actual hostname.
I worked around this by replacing 'localhost' in your webdriver config by the ip-address of the gitlab runner. You might want to check out my blog post about running codeception tests on gitlab-ci.
Probably the issue is that you are using http://localhost url and running selenium server on separate host.
Selenium tries to connect to port 80 of its own, not of the machine which is running tests.

No connection could be made because the target machine actively refused it. connect(2) for "127.0.0.1" port 9515 (Errno::ECONNREFUSED)

While running my simple selenium automation script on chrome broswer, i am getting below mentioned error. The script runs fine on firefox browser. Mine is HTTPS website.
No connection could be made because the target machine actively
refused it. - connect(2) for "127.0.0.1" port 9515
(Errno::ECONNREFUSED)
IDE: Ruby Mine 7.1.4
Chrome Browser: 54.0.2840.71 m (64-bit)
Script:
require "selenium/webdriver"
driver = Selenium::WebDriver.for :chrome
driver.get('http://google.com')
I had same problem as yours after Windows Update last time.
I updated chromedriver.exe from v2.9 to v2.24 and put it on bin directory where ruby installed, then it's fixed.

Selenium 2.53 not working on Firefox 28

I am getting error while using Firefox with webdriver.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect
to host 127.0.0.1 on port 7055 after 45000 ms.
Firefox version:28.0
Selenium-Java-2.37.0
selenium-server-standalone-2.53.0
Windows 7 / 64 bit
Is anyone getting a similar issue or any idea what is the solution for this. It's working fine with Chrome but with Firefox none of the URLs are getting loaded.
This exception occurs when selenium is not compatible with your version of Firefox. Try to downgrade selenium or upgrade Firefox. See this question on SO Webdriver Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms