2017-02-16 215 views
0

Linux操作系统Ubuntu 火狐43 硒2.53.1运行硒测试

我安装的Xvfb然后我做了这样的事情

的Xvfb:77 -ac

export DISPLAY =:77

然后我检查如果Firefox在Linux上工作($火狐) - >启动没有错误,并保持运行,直到我与控制-C杀死它

现在,我尝试使用詹金斯开始我硒测试。我指出了我的DISPLAY,但是当我运行测试时,我得到:

org.openqa.selenium.firefox.NotConnectedException:无法在45000 ms后连接到端口7055上的主机127.0.0.1。 Firefox控制台输出:

at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113) 
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271) 
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120) 
at com.rulefinancial.testing.webdriver.LocalFirefoxDriverProvider.getNewWebDriver(LocalFirefoxDriverProvider.java:16) 
at com.rulefinancial.testing.MainTest.beforeClass(MainTest.java:54) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86) 
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142) 
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178) 
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) 
at org.testng.TestRunner.privateRun(TestRunner.java:782) 
at org.testng.TestRunner.run(TestRunner.java:632) 
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) 
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) 
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) 
at org.testng.SuiteRunner.run(SuiteRunner.java:268) 
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) 
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244) 
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169) 
at org.testng.TestNG.run(TestNG.java:1064) 
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281) 
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75) 
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121) 
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) 
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) 
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) 

谁能告诉我这里会发生什么?如何解决这个问题呢? 它在Windows上工作正常 - 我的意思是ff 43和硒2.53.1

回答

1

检查X虚拟帧缓冲区的参数,当您启动它。我认为这个问题在这里。对我来说,它的工作,我一步一步按照headless execution of selenium tests in Jenkins博客文章。

+0

我尝试了很多来自不同的网站。解决方案与你的非常相似,但我从来没有工作,所以我有点灰心,但我必须说,你指出的文章是完美的,一切都很好:) :) 非常感谢@Konstantin – EdXX