2016-09-21 91 views
0

我創建了一個測試框架,通過使用硒webdriver和我運行相同的Firefox 44.0.2和2天后它工作正常。 但現在它打開Firefox瀏覽器,但不導航到不用彷徨方法中所提到的網址,下面是我的網址導航代碼和即時得到異常: -硒webdriver不打開應用程序url

WebDriver driver=new FirefoxDriver(); 
     driver.get("http://seleniumpractise.blogspot.in/2016/08/how-to-use-explicit-wait-in-selenium.html"); 

例外: -

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7056 after 45000 ms. Firefox console output: 
sions\\[email protected]","installDate":1474450844360,"updateDate":1474450844360,"applyBackgroundUpdates":1,"bootstrap":false,"size":3213569,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true,"hasBinaryComponents":true,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"3.0","maxVersion":"45.0"}],"targetPlatforms":[{"os":"Darwin","abi":null},{"os":"SunOS","abi":null},{"os":"FreeBSD","abi":null},{"os":"OpenBSD","abi":null},{"os":"WINNT","abi":"x86-msvc"},{"os":"Linux","abi":null}],"multiprocessCompatible":false,"signedState":0} 
1474450846803 addons.xpi DEBUG Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"4YrFqCoch9_A","location":"app-global","version":"44.0.2","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1473742108164,"updateDate":1473742108164,"applyBackgroundUpdates":1,"skinnable":true,"size":24172,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"44.0.2","maxVersion":"44.0.2"}],"targetPlatforms":[]} 
1474450846803 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd} 
1474450846804 DeferredSave.extensions.json DEBUG Save changes 
1474450846805 addons.xpi DEBUG Updating database with changes to installed add-ons 
1474450846805 addons.xpi-utils DEBUG Updating add-on states 
1474450846806 addons.xpi-utils DEBUG Writing add-ons list 
1474450846819 addons.manager DEBUG Registering shutdown blocker for XPIProvider 
1474450846820 addons.manager DEBUG Provider finished startup: XPIProvider 
1474450846820 addons.manager DEBUG Starting provider: LightweightThemeManager 
1474450846820 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager 
1474450846820 addons.manager DEBUG Provider finished startup: LightweightThemeManager 
1474450846820 addons.manager DEBUG Starting provider: GMPProvider 
1474450846832 addons.manager DEBUG Registering shutdown blocker for GMPProvider 
1474450846833 addons.manager DEBUG Provider finished startup: GMPProvider 
1474450846833 addons.manager DEBUG Starting provider: PluginProvider 
1474450846833 addons.manager DEBUG Registering shutdown blocker for PluginProvider 
1474450846833 addons.manager DEBUG Provider finished startup: PluginProvider 
1474450846833 addons.manager DEBUG Completed startup sequence 
1474450847985 addons.manager DEBUG Starting provider: <unnamed-provider> 
1474450847985 addons.manager DEBUG Registering shutdown blocker for <unnamed-provider> 
1474450847986 addons.manager DEBUG Provider finished startup: <unnamed-provider> 
1474450848873 DeferredSave.extensions.json DEBUG Starting write 
1474450849387 addons.repository DEBUG No addons.json found. 
1474450849387 DeferredSave.addons.json DEBUG Save changes 
1474450849393 DeferredSave.addons.json DEBUG Starting timer 
1474450849415 addons.manager DEBUG Starting provider: PreviousExperimentProvider 
1474450849415 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider 
1474450849416 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider 
1474450849420 DeferredSave.extensions.json DEBUG Write succeeded 
1474450849420 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 17 
1474450849457 DeferredSave.addons.json DEBUG Starting write 
1474450849470 DeferredSave.addons.json DEBUG Write succeeded 

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:122) 
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:117) 
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218) 
    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 dd_core.page.init(page.java:68) 
    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:85) 
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) 
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211) 
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) 
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:296) 
    at org.testng.SuiteRunner.run(SuiteRunner.java:259) 
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) 
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) 
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) 
    at org.testng.TestNG.run(TestNG.java:1018) 
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) 
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) 
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175) 

我加了selenium-java-2.48.2.jar。請提出建議!

+0

你可以請嘗試更新Firefox版本到46 –

回答

0

它工作正常與FF 46.0嘗試更新FF版本。

+0

@All: - 剛剛更新我的FF版本到46.0.1,但它拋出異常之上。 –

+0

可以共享您使用的.jar文件列表嗎? –

+0

@all: - 謝謝: - 通過更新我的硒罐文件到2.53.1版本問題得到解決。補充: - selenium-server-standalone-2.53.1.jar和selenium-java-2.53.1.jar問題得到解決! –

0

大多數的,它的發生是因爲瀏覽器版本的時候剛剛升級版本和運行代碼再次

相關問題