How to configure Marionnete Webdriver?

530 views
Skip to first unread message

Nir Pinchas

unread,
May 4, 2016, 8:53:18 AM5/4/16
to Selenium Users
Hello guys , 
I am trying to switch from FireFoxDriver to MarionetteDriver.
I managed to run firefox with MarionetteDriver by running:

public void runMarionnete(){
DesiredCapabilities dc = DesiredCapabilities.firefox();
OSUtils.setProperty("webdriver.firefox.bin", "C:\\Firefox\\firefox.exe");
OSUtils.setProperty("webdriver.gecko.driver","C:\\Drivers\\wires-0.6.2-win.exe"));
_driver = new MarionetteDriver(dc);
}

But I have 2 things I am not sure how to do:

1.How to add XPI extensions to the driver ? (in the old way I did FirefoxProfile.addExtension ...)
2.How to configure all the firefox properties , like I used to do , for example:

profile.setPreference("browser.startup.homepage;about:home","about:blank");
profile.setPreference("startup.homepage_welcome_url","about:blank");
profile.setPreference("browser.usedOnWindows10.introURL","about:blank");
profile.setPreference("devtools.devedition.promo.url","");
profile.setPreference("xpinstall.signatures.required",false);

Thank you!

⇜Krishnan Mahadevan⇝

unread,
May 4, 2016, 11:54:05 PM5/4/16
to Selenium Users
Are you looking for something like this ?

public void runMarionnete() throws IOException {
DesiredCapabilities dc = DesiredCapabilities.firefox();
System.setProperty("webdriver.firefox.bin", "C:\\Firefox\\firefox.exe");
System.setProperty("webdriver.gecko.driver","C:\\Drivers\\wires-0.6.2-win.exe");
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File("/somefileLocation"));
dc.setCapability(FirefoxDriver.PROFILE, profile);
RemoteWebDriver _driver = new MarionetteDriver(dc);
}

PS : I have not played around with Marionette driver, so am not sure if this would work. Its an educated guess that this should work, because MarionetteDriver only aims at decoupling the server component from the selenium codebase and move towards a Server component model that all the other browser flavors are following (IE/Chrome).
This would basically help Selenium start supporting the latest versions of Firefox, without having to go with a release.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/14e3164c-992d-4dff-9f6a-4e6e9284ebad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nir Pinchas

unread,
May 5, 2016, 5:16:12 AM5/5/16
to Selenium Users
Thank you for the answer! 
Unfortunately, It doesnt work at all. 
Did it work for you? 
Any other ideas ? 
Thanks

public void launchFirefoxMarionnete() throws Exception{
    FirefoxProfile profile = new FirefoxProfile();
    List<File> extensions = getExtensionsToDriver();
    for (File file : extensions) {
        profile.addExtension(file);
    }
    DesiredCapabilities dc = DesiredCapabilities.firefox();
    dc.setCapability(FirefoxDriver.PROFILE, profile);
    OSUtils.setProperty("webdriver.firefox.bin", new File(TestConfig.getInstance().get("BrowserPath")).getAbsolutePath());
    OSUtils.setProperty("webdriver.gecko.driver",PathConfig.getInstance().resolve("drivers","wires-0.6.2-win.exe"));
    _driver = new MarionetteDriver(dc);
}

Andreas Tolfsen

unread,
May 5, 2016, 7:19:50 AM5/5/16
to seleniu...@googlegroups.com
On Wed, 4 May 2016, at 13:53, Nir Pinchas wrote:
> 1.How to add XPI extensions to the driver ? (in the old way I
> did FirefoxProfile.addExtension ...)
> 2.How to configure all the firefox properties , like I used to do , for
> example:

When you set Firefox preferences, what happens behind the scenes is that
the client binding creates a new profile and sends that across to the
driver as a Base64 string.

Support for custom profiles landed just recently in 0.7.1:

https://github.com/mozilla/geckodriver/commit/3045c00a77b7ef7220ec9a6b318cae0756221a87

Please report any bugs you find with it to
https://github.com/mozilla/geckodriver/issues.

(Note that wires was renamed to “geckodriver” a few days ago.)

Nir Pinchas

unread,
May 5, 2016, 7:51:25 AM5/5/16
to Selenium Users
I am not sure how to check what your asking..but it looks like after running   :

FirefoxProfile profile = new FirefoxProfile();
List<File> extensions = getExtensionsToDriver();
for (File file : extensions) {
profile.addExtension(file);
}
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, profile);

when i inspect dc , the firefox_profile is save as "toString()" of profile :
{browserName=firefox, version=, platform=ANY, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile@1458ed9c}

⇜Krishnan Mahadevan⇝

unread,
May 5, 2016, 10:40:04 PM5/5/16
to Selenium Users
Nir,
Have you taken a look at the actual browser that was spawned by Marionette and see if it contains the xpi you are injecting ?
If not, then maybe you should write up a bug and submit it in the link that Andreas shared.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Nir Pinchas

unread,
May 8, 2016, 2:58:15 AM5/8/16
to Selenium Users
Yes , I checked and the extension is not there , as well as all other custom configs I tried to set..

sandeepjain

unread,
Jun 22, 2016, 2:12:52 AM6/22/16
to seleniu...@googlegroups.com
Hi I was able to use marionette driver when used "Marionettedriver
marionettedriver = new marionettedriver()" but I am unable to use marionette
with Remote webdriver. Here is the eg:

System.setProperty(“webdriver.gecko.driver”,
“…\\wires-0.6.2-win\\wires.exe”);
DesiredCapabilities cap = DesiredCapabilities.firefox();

cap.setCapability(“marionette”, true);
cap.setBrowserName(“firefox”);

driver = new RemoteWebDriver(new URL(“http://10.121.64.185:4444/wd/hub”),
cap);//true to enable the JS

final String url = “https://www.google.com/”;




--
View this message in context: http://selenium.10932.n7.nabble.com/How-to-configure-Marionnete-Webdriver-tp51156p52021.html
Sent from the Selenium - Users mailing list archive at Nabble.com.

venkatesh narla

unread,
Jun 22, 2016, 3:06:46 AM6/22/16
to Selenium Users
Hi,
     Even Marionette also having some issues. The best solution is install Firefox 46. This Issue may fix in the Firefox 48 which is going to release on 2nd Aug.

Thanks,
Venkatesh
Reply all
Reply to author
Forward
0 new messages