[英]Run selenium test using firefox on LInux
Linux Ubuntu Firefox 43 Selenium 2.53.1 Linux Ubuntu Firefox 43硒2.53.1
I installed Xvfb then I did something like this 我安装了Xvfb,然后做了这样的事情
Xvfb :77 -ac
Xvfb:77 -ac
and 和
export DISPLAY=:77
出口DISPLAY =:77
then I checked if firefox works on linux ($firefox) -> launched without error, and stay running until I kill it with Control-C 然后我检查了firefox是否可以在linux($ firefox)上运行->启动没有错误,并一直运行直到我用Control-C杀死它为止
Now I try to start my selenium tests using Jenkins. 现在,我尝试使用Jenkins开始进行硒测试。 I indicated my DISPLAY but when I run tests I get:
我指出了DISPLAY,但是当我运行测试时,我得到:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. org.openqa.selenium.firefox.NotConnectedException:在45000毫秒后无法连接到端口7055上的主机127.0.0.1。 Firefox console output:
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)
Can anyone tell me what happens here? 谁能告诉我这里发生了什么? How to solve this problem?
如何解决这个问题呢? It works fine on windows - I mean ff 43 and selenium 2.53.1
在Windows上工作正常-我的意思是ff 43和硒2.53.1
Check the parameters of the X virtual frame buffer, when you start it. 启动时检查X虚拟帧缓冲区的参数。 I think the issue is here.
我认为问题就在这里。 For me it worked, I did it step by step following headless execution of selenium tests in Jenkins blog post.
对我来说,它确实有效,我在詹金斯(Jenkins)博客文章中无休止地执行了硒测试之后,一步一步地做到了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.