在jenkins CI服务器上无法运行selenium webdriver / testng测试时出错

时间:2014-09-23 11:44:25

标签: jenkins selenium-webdriver testng

我正在使用testNG框架和ANT任务运行Selenium测试。测试在我的Windows机器上正常运行。然后我将它部署到我的Jenkins CI服务器上,并为无头运行测试做了必要的配置:

  • 在运行jenkins(CentOS)的服务器上安装了vnc-server

  • 为jenkins安装了Xvnc插件,并在构建期间启用了'运行Xvnc'在我的工作配置

但是我得到以下错误 - 任何帮助?我已经搜索过网络,但无法找到解决方案:" org.openqa.selenium.firefox.NotConnectedException:无法在45000毫秒后连接到端口7055上的主机127.0.0.1。 Firefox控制台"



[workspace] $ /root/.jenkins/tools/hudson.tasks.Ant_AntInstallation/Ant/bin/ant
Buildfile: /root/.jenkins/jobs/automationFramework/workspace/build.xml

compile:
    [javac] /root/.jenkins/jobs/automationFramework/workspace/build.xml:28: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 2 source files to /root/.jenkins/jobs/automationFramework/workspace/test-output

test:
   [testng] [TestNG] Running:
   [testng]   /root/.jenkins/jobs/automationFramework/workspace/src/automationFramework/testng.xml
   [testng] 
   [testng] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
   [testng] *** EM_LOG *** Item Installed via directory addition to Install Location: app-global Item ID: {972ce4c6-7e08-4474-a285-3208198ce6fd}, attempting to register...
   [testng] *** EM_LOG *** Item Installed/Upgraded at Install Location: app-global Item ID: {972ce4c6-7e08-4474-a285-3208198ce6fd}, attempting to register...
   [testng] *** Blocklist::_loadBlocklistFromFile: blocklist is disabled
   [testng] *** EM_LOG *** ... success, item is compatible
   [testng] *** EM_LOG *** Item Installed via directory addition to Install Location: app-profile Item ID: fxdriver@googlecode.com, attempting to register...
   [testng] *** EM_LOG *** Item Installed/Upgraded at Install Location: app-profile Item ID: fxdriver@googlecode.com, attempting to register...
   [testng] *** EM_LOG *** ... success, item is compatible
   [testng] *** EM_LOG *** Item Installed via directory addition to Install Location: app-system-user Item ID: langpack-en-GB@firefox.mozilla.org, attempting to register...
   [testng] *** EM_LOG *** Item Installed/Upgraded at Install Location: app-system-user Item ID: langpack-en-GB@firefox.mozilla.org, attempting to register...
   [testng] *** EM_LOG *** ... success, item is compatible
   [testng] 
   [testng] 	at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
   [testng] 	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
   [testng] 	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
   [testng] 	at automationFramework.GoogleTest.testGoogle(Unknown Source)
   [testng] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [testng] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   [testng] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [testng] 	at java.lang.reflect.Method.invoke(Method.java:606)
   [testng] 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
   [testng] 	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
   [testng] 	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
   [testng] 	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
   [testng] 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
   [testng] 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
   [testng] 	at org.testng.TestRunner.privateRun(TestRunner.java:767)
   [testng] 	at org.testng.TestRunner.run(TestRunner.java:617)
   [testng] 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
   [testng] 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
   [testng] 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
   [testng] 	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
   [testng] 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
   [testng] 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
   [testng] 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
   [testng] 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
   [testng] 	at org.testng.TestNG.run(TestNG.java:1057)
   [testng] 	at org.testng.TestNG.privateMain(TestNG.java:1364)
   [testng] 	at org.testng.TestNG.main(TestNG.java:1333)
&#13;
&#13;
&#13;

selenium v​​ersion-2.43 firefox - 3.6 Jenkins on centOS - 5.5

由于

1 个答案:

答案 0 :(得分:0)

通常由于FF和WD版本不兼容而发生。因此,仔细检查您使用的版本是否正确是有意义的。