我正在执行Jenkins的硒测试用例。我也想运行UI测试用例。但是当Jenkins被构建时,浏览器并没有启动。我使用Cent OS和FireFox。路径指定如下。浏览器从jenkins运行时不会自动启动
堆栈跟踪
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/lib64/firefox/firefox) on port 7055; process output follows:
Error: cannot open display: :99
Error: cannot open display: :99
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'nila.ejyothi.net', ip: '192.168.202.35', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.20.1.el7.x86_64', java.version: '1.7.0_91'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:130)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
at com.fetchinglife.application.modules.utilities.CommonFunctions.initBrowser(CommonFunctions.java:74)
at com.fetchinglife.application.modules.employee.EmployeeScheduleFunctionalTest.StartBrowser_NavURL(EmployeeScheduleFunctionalTest.java:34)
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: :99
Error: cannot open display: :99
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
Standard
请给我一个解决方案吗?
请提供詹金斯日志(用跟踪和完整的堆栈跟踪),所以我们可以看到的问题是什么。 –
如果测试期望用户界面,则需要考虑一些工具来提供“显示”。例如xvnc。 https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin。在我们去那里之前,请提供您看到的错误的详细信息。 – Jayan
上述错误是我在构建Jenkins时在我的堆栈跟踪中发现的。我需要在后台运行它并列出结果集。 – rParvathi