Reputation: 1796
I'm trying to run the following sample snippet
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
//System.out.println("My new program");
}
}
When I run this code, getting the following error.
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
e6fd}","syncGUID":"zxeywUS-QRBG","location":"app-global","version":"48.0","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 (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1469556455000,"updateDate":1469556455000,"applyBackgroundUpdates":1,"skinnable":true,"size":21899,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"48.0","maxVersion":"48.0"}],"targetPlatforms":[],"seen":true}
1471332673510 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
Firfox version is 48.0 Jar which added in eclipse is selenium-java-2.53.0, selenium-java-2.53.0-srcs.
Could anyone please help me to fix this issue.
Upvotes: 1
Views: 944
Reputation: 1467
Wes Young is right. Firefox changed behavior starting version 48. You need to use selenium 3 with gecko driver provided by firefox.
Little explanation : Before Selenium 3, FirefoxDriver used to be in form of Firefox Extension which used to get installed when we instantite firefox driver. But starting with version 48, Firefox made a change how extensions behave in firefox, basically every extension has to be signed by firefox and driver extension did not qualify for that. So Firefox took the responsibility of developing the standalone driver for firefox like we have in chrome. Basically you will have to download gecko driver place it somewhere and configure the path in webdriver.gecko.driver system variable and then use it. It is almost identical to how we use chromedriver now.
PS : we can still use previous versions of firefox with selenium 3 using old firefox driver (in extension form). There is a property to tell we want to use legacy driver (old firefox driver in extension form) or new driver (gecko driver). This has to be set in capabilities.
caps["marionette"] = True/False in python
Similar in other languages
Upvotes: 0
Reputation: 76
FireFox 48 brought in some changes that don't play nicely with webdriver. You will need to switch the firefox over to Marionette.
Instructions found here: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette
Upvotes: 1