【发布时间】:2012-03-23 23:20:07
【问题描述】:
我有一个运行一些 Selenium 测试的 ant 脚本。这在以Jenkins 用户身份从Windows 和Putty bash 终端运行时非常有效,因为必要的vncserver 之前由jenkins 用户启动并且DISPLAY 变量设置为:43。我在 Jenkins CI 服务器中调用相同的 ant 脚本。 DISPLAY 环境变量也在 Jenkins Web 界面中配置为 :43。我收到的错误信息如下:
[junit] Setting selenium logging level to: FINE
[junit] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7056 after 45000 ms. Firefox console output:
[junit] Xlib: connection to ":43.0" refused by server
[junit] Xlib: No protocol specified
[junit]
[junit] Error: cannot open display: :43
[junit]
[junit] at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:95)
[junit] at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:157)
[junit] at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:93)
[junit] at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:136) [junit] at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:78)
[junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [junit] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [junit] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
此消息与我在vncserver 启动时收到的消息非常相似,该用户与启动测试的用户不同。但是现在情况并非如此,因为我已经仔细检查了 testrunner 和启动的 VNC 都是 jenkins。
这是一个 Solaris 服务器,如果需要任何详细信息来帮助我,请询问。
【问题讨论】:
标签: java ant selenium jenkins continuous-integration