我有运行测试的盒子.看起来Jenkins会ssh并执行正在运行的特定作业中描述的命令.
在这里,我试图运行我的Selenium Webdriver测试,但它告诉我在启动firefox时出错.最终的想法是完全在这个盒子上运行网络测试,并拍摄一些错误的截图.
我正在使用selenium-java-2.25.jar,firefox 10,linux OS.
有趣的是,我可以手动ssh到框中,临时从盒子上的另一个用户复制魔术cookie(获得X隧道),做一个export DISPLAY=mydisplay:1.0,然后使用ant启动我的硒测试.这将带来firefox和测试就好了.
这里有各种各样的线程似乎有完全相同的问题,我想我已经尝试了大部分.这就是我所做的:
重新启动该框,使用VNC重新登录.
在运行selenium测试之前,在Jenkins中放置一个bash脚本来运行.bash脚本基本上只是做了一个export DISPLAY=mydisplay:1.0.它也执行xclock.这可以工作,因为我可以看到在VNC中显示xclock.
iptables已被关闭
firefox正确位于/ usr/bin/firefox中
sshd_config显示X11Forwarding为true.
据称降级firefox帮助了一些人,但我不想这样做.无论如何,Webdriver应该支持FF 10.
但是,上述都没有解决问题.
它似乎不存在localhost上的端口7055甚至存在:
netstat -an | grep 7055 - 什么都没打印
这是我的/ etc/hosts所说的:
1 127.0.0.1 localhost.localdomain localhost
2 ::1 localhost6.localdomain6 localhost6
Run Code Online (Sandbox Code Playgroud)
也许它与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 …Run Code Online (Sandbox Code Playgroud) 我使用selenium 2.35与之前版本的firefox更新到版本firefox 26.0之前.我的测试以前运行正常,但现在我最终收到以下错误.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: C:\Users\VISHAL~1.SIN\AppData\Local\Temp\anonymous4627406201097696285webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening XPI database C:\Users\VISHAL~1.SIN\AppData\Local\Temp\anonymous4627406201097696285webdriver-profile\extensions.json
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in …Run Code Online (Sandbox Code Playgroud)