【问题标题】:Running Selenium tests from Jenkins by invoking Ant通过调用 Ant 从 Jenkins 运行 Selenium 测试
【发布时间】: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


    【解决方案1】:

    我没有做任何不同的事情,但它在不久前得到了修复,所以这是一个好方法。魔法就这样发生了.. :-)

    【讨论】:

    • 有趣...你什么都没做,但答案是接受自己...哈哈哈
    • 是的。不过也许这个小故事给了一些人一点希望,所以我决定回答q并接受a。
    猜你喜欢
    • 2013-03-23
    • 2011-10-07
    • 1970-01-01
    • 2015-04-07
    • 1970-01-01
    • 1970-01-01
    • 2013-04-02
    • 2013-01-31
    • 1970-01-01
    相关资源
    最近更新 更多