Jenkins運行的自動化測試設置不時失敗。當測試設置失敗時,它將跳過所有其他測試設置和測試。它在Mozilla Firefox上運行。Selenium中的失敗testSetup
有沒有機會擺脫異常?
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7056 after 45000 ms. Firefox console output:
1469480338859 addons.manager DEBUG Application has been upgraded
1469480338873 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1469480338875 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1469480338879 addons.xpi DEBUG startup
1469480338880 addons.xpi DEBUG Skipping unavailable install location app-system-local
1469480338881 addons.xpi DEBUG Skipping unavailable install location app-system-share
1469480338882 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}
1469480338883 addons.xpi INFO Mapping [email protected] to C:\Users\user\AppData\Local\Temp\anonymous7098252712982546494webdriver-profile\extensions\[email protected]
1469480338883 addons.xpi INFO Mapping [email protected] to C:\Users\user\AppData\Local\Temp\anonymous7098252712982546494webdriver-profile\extensions\[email protected]
1469480338884 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: C:\Users\user\AppData\Local\Temp\anonymous7098252712982546494webdriver-profile\extensions\webdriver-staging
1469480338884 addons.xpi DEBUG checkForChanges
1469480338894 addons.xpi DEBUG Directory state JSON differs: cache [] state [{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1434617609039,"rdfTime":1417010916000}}},{"name":"app-profile","addons":{"[email protected]":{"descriptor":"C:\\Users\\user\\AppData\\Local\\Temp\\anonymous7098252712982546494webdriver-profile\\extensions\\[email protected]","mtime":1469480305220,"rdfTime":1469480305217},"[email protected]":{"descriptor":"C:\\Users\\user\\AppData\\Local\\Temp\\anonymous7098252712982546494webdriver-profile\\extensions\\[email protected]","mtime":1469480303712,"rdfTime":1469480303712}}}]
1469480338900 addons.xpi-utils DEBUG Opening XPI database C:\Users\user\AppData\Local\Temp\anonymous7098252712982546494webdriver-profile\extensions.json
1469480338901 addons.xpi DEBUG New add-on [email protected] installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1469480339870 addons.xpi-utils DEBUG Make addon app-profile:[email protected] visible
1469480339874 DeferredSave.extensions.json DEBUG Save changes
1469480339878 DeferredSave.extensions.json DEBUG Save changes
1469480339878 addons.xpi DEBUG New add-on [email protected] installed in app-profile
1469480339886 addons.xpi-utils DEBUG Make addon app-profile:[email protected] visible
1469480339887 DeferredSave.extensions.json DEBUG Save changes
1469480339887 DeferredSave.extensions.json DEBUG Save changes
1469480339887 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1469480339892 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1469480339893 DeferredSave.extensions.json DEBUG Save changes
1469480339893 DeferredSave.extensions.json DEBUG Save changes
1469480339907 addons.xpi DEBUG Updating database with changes to installed add-ons
1469480339907 addons.xpi-utils DEBUG Updating add-on states
1469480339908 addons.xpi-utils DEBUG Writing add-ons list
1469480339919 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1469480339921 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager
1469480339924 addons.manager DEBUG Registering shutdown blocker for OpenH264Provider
1469480339925 addons.manager DEBUG Registering shutdown blocker for PluginProvider
1469480349163 DeferredSave.extensions.json DEBUG Starting timer
1469480349708 DeferredSave.extensions.json DEBUG Starting write
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:124)
at com.intuit.ifs.csscat.core.WebDriverFactory.getWebDriver(WebDriverFactory.java:104)
at com.intuit.ifs.csscat.core.BaseTestNGWebDriver.testSetup(BaseTestNGWebDriver.java:71)
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:80)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:551)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:640)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:894)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1219)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:768)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1188)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1113)
at org.testng.TestNG.run(TestNG.java:1025)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:122)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:101)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe)
根據錯誤,firefox和selenium之間沒有進行firefox連接。你能確保版本和RAM的可用性是好的。 – selva