2016-04-01 35 views
2

Firefox'u Java kodu kullanarak selenyum webdriver ile çağırmaya çalışıyorum, Firefox tarayıcısı açılır, ancak aşağıdaki hata mesajı ile bir süre sonra herhangi bir test çalıştırmaz ve sonlandırılır. Lütfen yardım et.Selenium/Firefox çalışmıyor

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: 
ageURL":null,"contributors":["Mozilla  Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla  Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-   3208198ce6fd}.xpi","installDate":1458533452604,"updateDate":1458533452604,"applyBackgroundUpdates":1,"skinnable":true,"size":22012,"sourceUR  I":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales": [],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e- 13a3a9e97384}","minVersion":"45.0.1","maxVersion":"45.0.1"}],"targetPlatforms":[],"seen":true} 
1459488151820 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd} 
1459488151821 DeferredSave.extensions.json DEBUG Save changes 
1459488151821 addons.xpi DEBUG Updating database with changes to installed add-ons 
1459488151821 addons.xpi-utils DEBUG Updating add-on states 
1459488151823 addons.xpi-utils DEBUG Writing add-ons list 
1459488151826 addons.xpi DEBUG Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features \[email protected] 
1459488151827 addons.xpi DEBUG Calling bootstrap method startup on [email protected] version 0.1 
1459488151838 addons.manager DEBUG Starting provider: <unnamed-provider> 
1459488151838 addons.manager DEBUG Registering shutdown blocker for <unnamed-provider> 
1459488151838 addons.manager DEBUG Provider finished startup: <unnamed-provider> 
1459488151848 addons.manager DEBUG Registering shutdown blocker for XPIProvider 
1459488151849 addons.manager DEBUG Provider finished startup: XPIProvider 
1459488151849 addons.manager DEBUG Starting provider: LightweightThemeManager 
1459488151849 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager 
1459488151849 addons.manager DEBUG Provider finished startup: LightweightThemeManager 
1459488151849 addons.manager DEBUG Starting provider: GMPProvider 
1459488151853 addons.manager DEBUG Registering shutdown blocker for GMPProvider 
1459488151854 addons.manager DEBUG Provider finished startup: GMPProvider 
1459488151854 addons.manager DEBUG Starting provider: PluginProvider 
1459488151854 addons.manager DEBUG Registering shutdown blocker for PluginProvider 
1459488151854 addons.manager DEBUG Provider finished startup: PluginProvider 
1459488151854 addons.manager DEBUG Completed startup sequence 
1459488153145 DeferredSave.extensions.json DEBUG Starting write 
1459488153406 addons.repository DEBUG No addons.json found. 
1459488153406 DeferredSave.addons.json DEBUG Save changes 
1459488153409 DeferredSave.addons.json DEBUG Starting timer 
1459488153430 addons.manager DEBUG Starting provider: PreviousExperimentProvider 
1459488153430 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider 
1459488153430 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider 
1459488153433 DeferredSave.extensions.json DEBUG Write succeeded 
1459488153433 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 17 
1459488153462 DeferredSave.addons.json DEBUG Starting write 
1459488153602 DeferredSave.addons.json DEBUG Write succeeded 
1459488181051 addons.xpi DEBUG Calling bootstrap method shutdown on [email protected] version 0.1 
1459488181184 addons.manager DEBUG shutdown 
1459488181185 addons.manager DEBUG Calling shutdown blocker for <unnamed-provider> 
1459488181185 addons.manager DEBUG Calling shutdown blocker for XPIProvider 
1459488181185 addons.xpi DEBUG shutdown 
1459488181185 addons.xpi-utils DEBUG shutdown 
1459488181186 addons.manager DEBUG Calling shutdown blocker for LightweightThemeManager 
1459488181186 addons.manager DEBUG Calling shutdown blocker for GMPProvider 
1459488181188 addons.manager DEBUG Calling shutdown blocker for PluginProvider 
1459488181189 addons.manager DEBUG Calling shutdown blocker for PreviousExperimentProvider 
1459488181191 addons.xpi DEBUG Notifying XPI shutdown observers 
1459488181196 addons.manager DEBUG Async provider shutdown done 

at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:122) 
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:276) 
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:116) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:223) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:212) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125) 
at com.escttest.Test5.beforeClass(Test5.java:53) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) 
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) 
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) 
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) 
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) 
at org.testng.TestRunner.privateRun(TestRunner.java:767) 
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:52) 
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) 
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) 
at org.testng.TestNG.run(TestNG.java:1057) 
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:115) 
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:207) 
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:178) 
+0

:) yardımcı olacaktır Umut? – Abhinav

+0

En son selenium sürümüne sahip olmalısınız, bu sorun çözülebilir –

+0

Lütfen firefox'unuzu ve selenyum api'nizi güncelleyin, sorununuzu çözecektir –

cevap

2

Bu, Firefox tarayıcısının en son tarayıcısındaki yeni sorun nedeniyle gerçekleşiyordu.

Selenyum kavanozlarınızı güncelleyin. Firefox'un yeni sürümü (Veya farklı bir tarayıcı), selenyumun eski kavanozlarını desteklemiyor. Selenyum Müşteri & WebDriver dili ile bağlanma

kullandığınız eski kavanoz yerine onları

İndir hem Selenyum Sunucusu (eski Selenyum RC Sunucusu). Güncellenmiş sonuçları elde edebilmeniz için sizin mozilla güncelleyin

kaynak: - http://docs.seleniumhq.org/download/

ayrıca firefox Profil xpinstall.signatures.required", false olarak setPreference ve ardından sürücü nesnesine geçmesi gerekiyor bu konuda gelen aşmak için

firefoxProfile.setPreference("xpinstall.signatures.required", false); 

Aşağıdaki kod benim için iyi çalışıyor.

static WebDriver driver=null; 
public static void main(String[] args) { 
final FirefoxProfile firefoxProfile = new FirefoxProfile(); 
firefoxProfile.setPreference("xpinstall.signatures.required", false); 
driver = new FirefoxDriver(firefoxProfile); 
driver.get("https://www.google.de/"); 

Eğer ateş sürümü ve selenyum sen ne kullanıyorsun edilir