0

Hi I need a little help, I'm working with selenium 3.0.1. However, I need to change to 2.53.1 because Actions (moveto and doubleclick) are not implemented yet for Firefox.

I was able to have the firefox webdriver for selenium 3.0.1. Since I downgrade it, I cannot run Firefox (chrome and IE are good!).

My code is :

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setPlatform(Platform.WIN10);
switch (browserType){
   case Firefox:
            FirefoxDriverManager.getInstance().setup();
            //capabilities.setCapability("marionette", true); 
            capabilities.setBrowserName("firefox");
            capabilities.setVersion("46");

            ProfilesIni profile = new ProfilesIni();
            FirefoxProfile ffProfile = profile.getProfile("default");
            //accept the certificate
            ffProfile.setAcceptUntrustedCertificates(true);
            ffProfile.setAssumeUntrustedCertificateIssuer(false);
            capabilities.setCapability(FirefoxDriver.PROFILE, ffProfile);
            WebDriver  webDriver = new FirefoxDriver(capabilities);

            break;
  //... case for Chrome and IE
}
webDriver.manage().window().maximize();
webDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

The error is :

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

Seems to be a compatibility issue... but I didn't find out yet.

Thanks

EDIT : I'm using this to load the webdriver : https://github.com/bonigarcia/webdrivermanager

Boni García
  • 4,618
  • 5
  • 28
  • 44
Bob
  • 529
  • 1
  • 7
  • 28

2 Answers2

1

So I see you are asking for version 46 but are you sure your browser didnt update past 46?

Selenium 2.53.1 does not work with versions of FF greater than 46.

Buster
  • 685
  • 1
  • 5
  • 28
  • If I set the version in capability, it isn't "force" the FF version? like IE with the compatibility mode? Because, yes, on my laptop I've a FF version 50 – Bob Jan 10 '17 at 16:44
  • 1
    No it does not downgrade the browser. It is just instructions if you are using Selenium Grid, that way when Selenium is creating the browser it knows to look for a firefox instance with a version "46". That way you can have a machine with multiple FF instances and they could be different browsers. Here is a download link for FF v 46 https://ftp.mozilla.org/pub/firefox/releases/46.0/ – Buster Jan 10 '17 at 16:47
  • Thanks, yes I'm using selenium Grid. But I'm testing on my local machine before. Thanks for your help, I'll test it and will keep you inform but I think it was my problem – Bob Jan 10 '17 at 16:49
  • Working. I needed to uninstall the FF version 50 and install the 46 (32Bits for me). Thanks for your help ! – Bob Jan 10 '17 at 16:59
0

You need to use geckodriver for running firefox with Selenium 3.

https://github.com/mozilla/geckodriver

Cathal
  • 1,318
  • 1
  • 12
  • 19
  • I cannot because Action are not implemented yet, see : https://github.com/mozilla/geckodriver/issues/233 I'm still watching this issue but developer are working on it – Bob Jan 10 '17 at 16:28
  • In that case you need to downgrade firefox and selenium or find an alternative approach other then using actions. – Cathal Jan 10 '17 at 16:32
  • :) yes I downgraded selenium... But I have a compatibility issue.. that's the topic of my post. Firefox seems to be in the incorrect version or the webdriver is not the good one.. I didn't find any information about this compatibility yet – Bob Jan 10 '17 at 16:34
  • maybe im being unclear! check out this question: http://stackoverflow.com/questions/37693106/selenium-2-53-not-working-on-firefox-47 – Cathal Jan 10 '17 at 16:36
  • I'm using Boni Garcia's maven solution. – Bob Jan 10 '17 at 16:41