mardi 14 juin 2016

How to support both older and newer version of Firefox simultaneously using selenium (Java)

I have two version of Firefox in my two PC one has newest which is 47 and one has older which is 43.

I have following this and setup RemoteWebDriver with Marionette, the next generation of FirefoxDriver to support Firefox version 47 for automation as below :-

URL server = new URL("http://localhost:4444/wd/hub")
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver webDriver = new RemoteWebDriver(server, capabilities);
webDriver.get("https://www.google.co.in");

It's working fine with Firefox version 47 but when I'm running same on other PC where installed Firefox version 43, it's giving exception as below :-

Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not sta

rt a new session. Possible causes are invalid address of the remote server or br

owser start-up failure.

Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'

System info: host: 'com-PC', ip: '192.168.3.3', os.name: 'Windows 7', os.arch: '

x86', os.version: '6.1', java.version: '1.8.0_92'

Driver info: driver.version: MarionetteDriver

Caused by: org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHost

ConnectException: Connect to localhost:3125 [localhost/127.0.0.1] failed: Connec

tion refused: connect

Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'

System info: host: 'com-PC', ip: '192.168.3.3', os.name: 'Windows 7', os.arch: '

x86', os.version: '6.1', java.version: '1.8.0_92'

Driver info: driver.version: MarionetteDriver

Caused by: java.net.ConnectException: Connection refused: connect

WARN - Exception: Connection refused: connect

When I removes line capabilities.setCapability("marionette", true); means removes MarionetteDriver support, it's working well with Firefox version 43 but raising exception with Firefox version 47 ie. UnreachableBrowserExcetion.

So my question is :-

There is any way to know Firefox version or any othere solution by which I could run simultaneously with both Old and New version of Firefox??.

Thanks in advance...:)

Aucun commentaire:

Enregistrer un commentaire