웹 드라이버 45000ms 후에 포트 7055에서 호스트 127.0.0.1에 연결할 수 없습니다
테스트를 실행하는 상자가 있습니다. Jenkins가 실행중인 특정 작업에 설명 된 명령을 ssh하고 실행하는 것처럼 보입니다.
여기에서는 Selenium Webdriver 테스트를 실행하려고하는데 파이어 폭스를 시작하는 데 오류가 있음을 알려줍니다. 최종 아이디어는이 상자에서 웹 테스트를 완전히 실행하고 오류의 스크린 샷을 만드는 것입니다.
selenium-java-2.25.jar, firefox 10, Linux OS를 사용하고 있습니다.
재미있는 점은 상자에 수동으로 ssh를 넣고 상자에있는 다른 사용자의 마술 쿠키를 일시적으로 복사하고 (X 터널을 얻기 위해)을 수행 한 export DISPLAY=mydisplay:1.0
다음 개미를 사용하여 셀레늄 테스트를 시작할 수 있다는 것입니다. 그리고 이것은 파이어 폭스와 테스트를 올릴 것입니다.
여기에 똑같은 문제가있는 것처럼 보이는 여러 가지 스레드가 있으며 대부분 시도했습니다. 여기 내가 한 일이 있습니다.
상자를 재부팅하고 VNC로 다시 로그인하십시오.
셀레늄 테스트를 실행하기 전에 Jenkins에서 bash 스크립트를 실행했습니다. bash 스크립트는 기본적으로
export DISPLAY=mydisplay:1.0
. 또한 실행xclock
됩니다. 이것은 VNC에 xclock이 표시되는 것을 볼 때 작동합니다.iptables가 꺼져 있습니다
firefox가 / usr / bin / firefox에 올바르게 있습니다.
sshd_config는 X11Forwarding이 true로 표시됩니다.
아마도 파이어 폭스를 다운 그레이드하면 일부 사람들이 도움이되었지만 나는 이것을하고 싶지 않습니다. 웹 드라이버는 어쨌든 FF 10을 지원해야합니다.
그러나 위의 어느 것도 문제를 해결하지 못합니다.
localhost의 포트 7055가 존재하지 않는 것 같습니다.
netstat -an | grep 7055
-아무것도 인쇄하지 않습니다
이것이 내 / etc / hosts가 말하는 것입니다.
1 127.0.0.1 localhost.localdomain localhost
2 ::1 localhost6.localdomain6 localhost6
아마도 localhost : 7055와 관련이 있습니까? 여기서 어디로 가야할지 모르겠습니다. 여전히, 왜 오류 출력에 display: :0.0
내가 지정한 시점을 찾고 있다고 표시 mydisplay:1.0
합니까?
그리고 마지막으로 내가받은 오류 출력 :
[testng] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
[testng] Xlib: connection to ":0.0" refused by server
[testng] Xlib: No protocol specified
[testng]
[testng] Error: cannot open display: :0.0
[testng] Xlib: connection to ":0.0" refused by server
[testng] Xlib: No protocol specified
[testng]
[testng] Xlib: connection to ":0.0" refused by server
[testng] Xlib: No protocol specified
[testng]
[testng] Xlib: connection to ":0.0" refused by server
[testng] Xlib: No protocol specified
[testng]
[testng] Error: cannot open display: :0.0
[testng]
[testng] at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:109)
[testng] at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:245)
[testng] at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:109)
[testng] at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:185)
[testng] at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:178)
[testng] at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:174)
[testng] at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)
[testng] at com.test.webtest.browser.BrowserFactory.createBrowser(BrowserFactory.java:24)
[testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[testng] at java.lang.reflect.Method.invoke(Method.java:601)
이 문제를 해결했는지 모르겠지만 다른 쪽에서도 동일한 문제를 해결했습니다.
Selenium과 Firefox가 서로 대화하는 데 어려움이있는 것 같습니다. 여러 릴리스에서 Firefox의 '진화'변경 사항이 의심되므로 이전 버전과의 호환성이 항상 보장되는 것은 아니며 호환성이 항상 동일한 오류를 발생시키는 것으로 보입니다.
FF 15에서 FF 16으로 옮길 때 문제가 시작되었습니다. 우분투에서 실행하면 다른 업그레이드와 함께 자동으로 발생하지만 이것이 중요한 변화라고 생각합니다.
The problem was resolved by moving from Selenium 2.24.1 to Selenium 2.25.0
As the selenium change is just download the jar file and run it instead of the old one,it's worth trying this as a quick and easy troubleshooter - if it doesn't help, just switch back. In your case, I'm not sure which version of Selenium to try, but I think 2.24 should work with FF 10.
Another issue I have found in the past is that Firefox would not run as root on Ubuntu. This happens if Selenium is running as a service, or possibly if it is fired up from a bash script or cron job. This may explain why it runs for you but not for Jenkins.
I had a similar issue. Maybe this answer will help you as well.
It looks like you have two different errors going on:
Unable to connect to host 127.0.0.1 on port 7055
Error: no display specified
The reason for the Unable to connect
error is that the version of Selenium Server does not know how to work with the newer version of Firefox. You need to download a newer version of the Selenium Server that supports the newer version of Firefox.
The reason for the Error: no display specified
error is that Firefox is being launched, but there is no X server (GUI) running on the remote host. You can use X11 forwarding to run Firefox on the remote host, but display it on your local host. On Mac OS X, you will need to download XQuartz in order to use X11 forwarding.
You need to check the browser compatibility before opting to test with Selenium:
https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG
This might help to answer the above question.
Get the latest Selenium jars (2.30) for FireFox 19
You can download the latest jars (2.31 as of writing) here: https://code.google.com/p/selenium/downloads/list
I resolved this issue by downgrading my Firefox to an older version that had previously worked well with Selenium-WebDriver. In my case, I had to downgrade back to Firefox 18 and this version worked with Selenium 2.27
Here is the link to get older versions of firefox: https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
This issue has haunted me for long time and I have seen one working solution in case of Firefox was to use the upgraded firefox driver.
If your firefox upgrades are happening automatically than you may face this problem once in a while. Looks like Firefox guys are developing too fast, or they do not care about backward compatibility.
Every time I see this issue on my old scripts I check if the firefox version has changed since - most of the times it is.
Then I go to maven repo for selenium firefox driver repo - http://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver and download the latest version.
or update my pom.xml (if maven is used) with new version of firefox driver right now its - 2.40.0
There is no easy way to avoid this issue unless you really explicitly block the automatied update from firefox (You can do this (On Mac) in preferences - Advanced - Update - Select "Check for updates, but let me choose whether to install them")
If your scripts are running on a automated mode then you may want to disable updates. However this may create other issues. Since most people/user may have firefox updates enabled by default. So your application is not really being tested on any later versions.
I had Firefox 47 and Selenium 2.53, and i got the same error. My solution was change Firefox 47 to Firefox 46, the problem was solved.
Update selenium jars, download selenium 2.31.0
This issue has been resolved by the selenium guys
This was a compatibility issue.
Cheers
The problem with the script is that the environment used for the script is not the same as the one used for your tests, so setting the environment variables there does nothing for your tests.
To properly set the variable you need to set it in Jenkins. Go to Manage Jenkins>Manage Nodes>Master>Configure. Check the Environment variables check box, then enter DISPLAY in the name box, and set the value to :1.0.
Additionally you'll need to set permissions, try disabling your xhost access controls using xhost +
in the terminal.
I also faced the same problem. Whenever we or webdriver opens up the FF browser will check for the updates if any. In that case, i will try to update during the execution time and then you will be getting the error even if it is updated properly just because you have not update the Selenium version appropriately.
Navigate to "http://docs.seleniumhq.org/download/" and download the latest version. Now go and check, the problem would be resolved, indeed. :)
I got the same error; I've used selenium-java version 2.25.0 and Firefox vresion 18.0.2; I've changed the version of selenium-java to 2.30.0 and now works.
For solve this issue, use new jar files available on http://docs.seleniumhq.org/download/. As respective to java, C#, php etc...Firefox 27.0.1 require 2.39.0 of driver version.
Just install Xvnc Plugin in Jenkins. The problem should be solved.
I got the same error "selenium_Unable to connect to host 127.0.0.1 on port 7055" Solution : I've used selenium-java-2.48.2 with Firefox version 43.0.1 and now its working well.
Me too had the same problem but issue is resolved after downgrading firefox version to 35.0.1 and my selenium version is 2.43
I had the exact same problem running docker but I found the solution in the log preceding the error you've mentioned.
selenium_1 | 2016-11-11 11:19:34,498 DEBG 'xvfb' stderr output:
selenium_1 | (EE)
selenium_1 | Fatal server error:
selenium_1 | (EE) Server is already active for display 99
selenium_1 | If this server is no longer running, remove /tmp/.X99-lock
selenium_1 | and start again.
selenium_1 | (EE)
I've followed the advice and problem has been sorted out.
This is how it's behaved when I used static property of IWebDriver and call it from multiple test methods.
public class LanguageMenu
{
private static IWebDriver drv;
static LanguageMenu()
{
drv = Driver.Instance;
}
...
public static void English()
{
drv.FindElement(By.Id("mvc_lang_en"));
el.Click();
}
public static void Rusian()
{
...
}
...
}
Like
[TestMethod]
public void Language_SwitchTo_English()
{
LanguageMenu.English();
Assert.IsTrue(ContactPage.IsAt("Contact"));
}
[TestMethod]
public void Language_SwitchTo_Rusian()
{
LanguageMenu.English();
Assert.IsTrue(ContactPage.IsAt("Контакт"));
}
Solution
For each calling test methods create new instance of Driver
private static void English()
{
var drv = Driver.Instance;
var el = drv.FindElement(By.Id("mvc_lang_en"));
el.Click();
}
Update selenium jars if our selenium script is not executing. Currently i am using selenium-java-2.43.0-srcs
Now it is working fine
It happens on different versions of ff. I'm using latest ff version 39 by using selenium-server-standalone-2.41.0.jar and selenium-java-2.41.0.zip which shows same error.
Get the latest server and client jar files here for the compatibility i used server and client versions 2.47.0 and 2.47.1 respectively. And Boom! It worked.
This happens because of old versions. Just update the browser to latest version and update the selenium webdriver package to latest version.
Just Restart the terminal. Terminal is hanged nothing else. Everything will work fine after that
Adding to the knowledge base. We had the same issue on Bamboo. The problem was resolved by using the Environmental Properties on Bamboo.
DISPLAY=":1"
Adding the value as system properties in the pom.xml, or the command line did not work.
On Windows: Check as well the "bitness" of your Firefox. Firefox 43.0.1 64bit does not work with Selenium 2.50.0. Working well with Firefox 43.0.1 32bit ...
I too was stuck at this error for three days and finally figured it out.You can view the answer I have given here .This is browser and selenium server compatibility issue. I hope this helps.You can check browser compatibility from this link
I had the same problem today. To fix I downgraded firefox version 51 to 47 and it's working.
Note: I'm using a Linux Ubuntu Mate, in a Virtual Box, with host being another Ubuntu Mate. All OS are 64 bits and firefox also.
Installed Firefox Setup 18.0.exe it works for me
I had the same issue with firefox 38.
After using following version dependencies, I could resolve the issue.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.53.0</version>
</dependency>
I think this could be a problem of display. If you do not have GUI in the box, then launching firefox from selenium webdriver would give this error.
To resolve this, first install Xvfb [yum install Xvfb -y
]( a virtual display driver) in the box. Then run your test from jenkins with xvfv-run -a -d <your test execution command>
. This will launch the browser in a virtual display buffer. Also it is capable of getting screenshots using selenium webdriver.
Solution -
1) Upgrade your Selenium Server i.e. selenium jar "selenium-server-standalone-2.xx.x.JAR" TO "selenium-server-standalone-2.45.0.JAR"
2) Upgrade your Selenium Client Driver i.e. selenium libs folder "selenium-java-2.xx.x" TO "selenium-java-2.45.0"
3) Check and Install compatible Firefox version
Refer - Download updated selenium libs & jar i.e. Version 2.45.0
This will RESOLVE your problem.. Cheers !!
'Programming' 카테고리의 다른 글
초과 비 실행 Docker 컨테이너에 대해 걱정해야합니까? (0) | 2020.06.24 |
---|---|
java.net.SocketException의 원인 : 연결 재설정? (0) | 2020.06.24 |
순수 JavaScript Graphviz 상당 (0) | 2020.06.24 |
string_view는 무엇입니까? (0) | 2020.06.24 |
RegisterStartupScript와 RegisterClientScriptBlock의 차이점은 무엇입니까? (0) | 2020.06.24 |