I have multiple version of Firefox
in multiple PCs where some has newest which is 47
and some has older version.
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 PCs where installed Firefox older version, 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 older version but raising exception
with Firefox version 47 ie. UnreachableBrowserExcetion
.
So my question is :-
Is there any way to know Firefox version
or any othere solution by which I could run simultaneously with both Old and New version of Firefox??.
I want a generic solution where my code intelligently could be able to know when it will start with MarionetteDriver
and when with FireFoxDriver
on the basis of FireFox Version
.
Thanks in advance...:)