1

how is it possible to use marionetteDriver with a FF 48 portable? I know how it works with installed Firefox 48:

String marionetteDriverLocation = getClass().getClassLoader().getResource("[PATH_TO_GECKODRIVER]/wires.exe").getPath();
System.setProperty("webdriver.gecko.driver", marionetteDriverLocation);
WebDriver driver = new MarionetteDriver(createDefaultCapabilitiesFirefox());

and firefox portable up to 46:

FirefoxBinary binary = new FirefoxBinary(new File(firefoxPortablePath));
WebDriver driver = new FirefoxDriver(binary, createFirefoxProfile(),createDefaultCapabilitiesFirefox());

But what do I have to do when i'd like to use a portable Firefox 48?

Pirax
  • 117
  • 1
  • 10

2 Answers2

2

Finally works. gecko 0.8.0 or 0.9.0 makes no difference. Thank you very much @Saurabh Gaur You made my day!

working code:

String marionetteDriverLocation = getClass().getClassLoader().getResource("[PATH_TO_GECKODRIVER]//wires.exe").getPath();
System.setProperty("webdriver.gecko.driver",marionetteDriverLocation);
DesiredCapabilities capabilities = createDefaultCapabilitiesFirefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new MarionetteDriver(capabilities);
Pirax
  • 117
  • 1
  • 10
0

Try same as you are using for 46. Only changes is just use setCapability("marionette", true); into DesiredCapabilities as below :-

String marionetteDriverLocation = getClass().getClassLoader().getResource("[PATH_TO_GECKODRIVER]/wires.exe").getPath();
System.setProperty("webdriver.gecko.driver", marionetteDriverLocation);

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);

FirefoxBinary binary = new FirefoxBinary(new File(firefoxPortablePath));

WebDriver driver = new FirefoxDriver(binary, createFirefoxProfile(), capabilities);
Pirax
  • 117
  • 1
  • 10
Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73
  • Its the same result as without marionette=true. The browser starts but displays a white window. Is it possible, that geckodriver for FF48 only works with Selenium3? I use gecko0.9.0 because the newer one needs WebDriver3/Java8 – Pirax Aug 17 '16 at 11:44
  • What is your current selenium version?? – Saurabh Gaur Aug 17 '16 at 11:57
  • Selenium 2.53.1 geckodriver-v0.9.0-win64 Firefox 48.0 Btw. When i use MarionetteDriver with FF portable 44 it works with or without desired cap marionette=true – Pirax Aug 17 '16 at 12:02
  • Once try with downgraded version of geckodriver to 0.8.0 and let me know.. – Saurabh Gaur Aug 17 '16 at 12:06
  • Or upgrade your selenium 2.53.1 to 3 with geckodriver 0.10.0 and use same provided code and let me know.. – Saurabh Gaur Aug 17 '16 at 12:09