4

I have been doing research into implementing Selenium Webdriver (currently version 2.49) for testing on Firefox. Currently I am capable of testing Chrome with the framework, but would like to extend this.

Based on my research so far, it seems Mozilla are pushing the Marionette API for interacting with the browser, rather than using the older FirefoxDriver. However after attempting to implement this I have had nothing but problems.

On my testing machines (OS X El Capitan and Debian 8.2) I have installed the selenium-standalone-server and the 'wires' middleware to allow for Firefox Marionette to communicate with the Selenium server. I've been testing with the current Firefox Nightly build and Selenium Webdriver for Java.

I am currently setting up the RemoteWebDriver capabilities as so;

String profileName = System.getProperty("webdriver.firefox.profile", "Webdriver");
ProfilesIni profiles = new ProfilesIni();
FirefoxProfile profile = profiles.getProfile(profileName);
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(true);

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capabilities.setJavascriptEnabled(true);
capabilities.setCapability("marionette", true);

And creating the RemoteWebDriver itself as follows;

driver = new RemoteWebDriver(new URL(address), capabilities);

This seems to work for actually launching the browser and sending the first few commands to the Selenium server. However when the 'wires' application receives the data, it doesn't use it from what I can gather. When creating a new Firefox session, the required capabilities (such as circumventing SSL cert checks) are not passed along.

1453306234222   Marionette  TRACE   conn0 -> [0,1,"newSession",{"capabilities":null,"sessionId":null}]

The certificates for the sites in question are self-signed, though the URLs mismatch (and due to the number of sites, installing new SSL certs will take some time). However I would expect the 'acceptSslCerts' capability to handle this correctly.

Has anyone encountered any problems like this before? And if not, what options do I have to avoiding the SSL cert checks?

2 Answers 2

2

Instead you should create Firefox profile in order to invoke it locally.

Refer this : http://www.howtogeek.com/209320/how-to-set-up-and-use-multiple-profiles-user-accounts-in-firefox/

This should resolve your problem.

1
  • This is something I've looked at a bit. I'll at least give it a shot for testing on my local machine. However I'm unsure if it will solve my problem completely as the tests are intended to be a part of the CI environment I have. These get triggered once a day from a Jenkins build, targeting a Selenium standalone server running in a different server entirely. If it can at least help with local testing that's still progress however!
    – Jordan B
    Mar 7, 2016 at 14:41
-1

See this page for more information on Marionette and profiles. https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Developer_setup#Starting_a_Marionette-Enabled_Firefox_without_runtests.py

1
  • What is Marionette and how does it apply here? I want to assume you're on to something good here but I just don't know what it is...
    – corsiKa
    Oct 26, 2016 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.