在Jenkins中运行Selenium Webdriver时出错

时间:2014-02-27 09:23:11

标签: linux selenium jenkins

我收到以下错误。我在jenkins上运行ant任务来运行测试用例..

[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] Error: no display specified
[testng] Error: no display specified

请为我提供解决此问题的方法。

谢谢。

1 个答案:

答案 0 :(得分:1)

在项目配置中,您应该有一个选项:

Start Xvfb before the build, and shut it down after

在这里,您可以通过属性Xvfb specific displayname指定selenium应使用的显示内容。您应该将其设置为0.如果您没有该选项,则应安装xvfb插件。

或者ssh进入工作者并写下export DISPLAY=:0.0