TestProject Forum
Powered by leading experts in the test automation community

Firefox webdriver not loading url, throwing NotConnectedException

I am running a few simple lines of code:

WebDriver driver = new FirefoxDriver(); driver.navigate().to("http://www.google.com");

and i’m getting this exception thrown in console:

[code]org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
tributors"]},“visible”:true,“active”:true,“userDisabled”:false,“appDisabled”:false,“descriptor”:“C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}”,“installDate”:1455699479256,“updateDate”:1455699479256,“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”:}
1457618781167 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1457618781171 addons.xpi DEBUG Updating XPIState for {“id”:“fiddlerhook@fiddler2.com”,“syncGUID”:“D-Y_MHg5pdpM”,“location”:“winreg-app-global”,“version”:“2.4.9.7”,“type”:“extension”,“internalName”:null,“updateURL”:null,“updateKey”:null,“optionsURL”:null,“optionsType”:null,“aboutURL”:“chrome://fiddlerhook/content/about.xul”,“icons”:{},“iconURL”:“chrome://fiddlerhook/content/fiddlerhook.png”,“icon64URL”:null,“defaultLocale”:{“name”:“FiddlerHook”,“description”:“Integrate Fiddler into Firefox”,“creator”:“Telerik”,“homepageURL”:“https://fiddler2.com/r/?FIDDLERHOOKHELP"},“visible”:true,“active”:false,“userDisabled”:true,“appDisabled”:true,“descriptor”:"C:\Program Files (x86)\Fiddler2\FiddlerHook”,“installDate”:1428323738406,“updateDate”:1428323738406,“applyBackgroundUpdates”:1,“bootstrap”:false,“size”:33877,“sourceURI”:null,“releaseNotesURI”:null,“softDisabled”:false,“foreignInstall”:true,“hasBinaryComponents”:false,“strictCompatibility”:false,“locales”:,“targetApplications”:[{“id”:"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",“minVersion”:“4.0”,“maxVersion”:“37.*”}],“targetPlatforms”:,“multiprocessCompatible”:false,“signedState”:0}
1457618781172 DeferredSave.extensions.json DEBUG Save changes
1457618781173 addons.xpi DEBUG Updating database with changes to installed add-ons
1457618781173 addons.xpi-utils DEBUG Updating add-on states
1457618781175 addons.xpi-utils DEBUG Writing add-ons list
1457618781186 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1457618781186 addons.manager DEBUG Provider finished startup: XPIProvider
1457618781186 addons.manager DEBUG Starting provider: LightweightThemeManager
1457618781186 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager
1457618781186 addons.manager DEBUG Provider finished startup: LightweightThemeManager
1457618781187 addons.manager DEBUG Starting provider: GMPProvider
1457618781192 addons.manager DEBUG Registering shutdown blocker for GMPProvider
1457618781192 addons.manager DEBUG Provider finished startup: GMPProvider
1457618781192 addons.manager DEBUG Starting provider: PluginProvider
1457618781192 addons.manager DEBUG Registering shutdown blocker for PluginProvider
1457618781192 addons.manager DEBUG Provider finished startup: PluginProvider
1457618781192 addons.manager DEBUG Completed startup sequence
1457618782029 addons.manager DEBUG Starting provider:
1457618782030 addons.manager DEBUG Registering shutdown blocker for
1457618782030 addons.manager DEBUG Provider finished startup:
1457618782523 DeferredSave.extensions.json DEBUG Starting write
1457618782749 addons.repository DEBUG No addons.json found.
1457618782749 DeferredSave.addons.json DEBUG Save changes
1457618782751 DeferredSave.addons.json DEBUG Starting timer
1457618782762 addons.manager DEBUG Starting provider: PreviousExperimentProvider
1457618782762 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider
1457618782762 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider
1457618782765 DeferredSave.extensions.json DEBUG Write succeeded
1457618782765 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 17
1457618782805 DeferredSave.addons.json DEBUG Starting write
1457618782840 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:276)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:221)
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 Demo.main(Demo.java:13)[/code]

What prompted such behaviour? all i did was simply try to navigate to a url

It seems like this is an issue with Firefox’s version on your machine. Your firefox seems to have a higher version than what selenium webdriver currently supports.
If you don’t want to downgrade it you could simple run selenium webdriver with chrome or internet explorer.

just download the chromedriver.exe from selenium’s website, and add this line of code to set a system property for chromedriver’s path before instantiating a ChromeDriver().

System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe"); WebDriver driver = new ChromeDriver();

You can find old (firefox) browsers here:

http://www.oldapps.com/category/browsers

https://ftp.mozilla.org/pub/firefox/releases/