0

I have lots of problem with Firefox. For most of them, I found lots of solution that use FirefoxDriver object. However I need to use RemoteWebDriver.

All the solutions to my problem use a FirefoxProfile object. is there a way to use this profile for the IWebDriver?

One of the thing I need to do is use the profile to do this:

Firefox webdriver opens first run page all the time

here is how I use my IWebDriver:

driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), DesiredCapabilities.Firefox(), TimeSpan.FromSeconds(timeout));
Community
  • 1
  • 1
Maxime Joyal
  • 183
  • 1
  • 12

1 Answers1

1

First create the FirefoxProfile and then add it to the capabilities:

// create the profile
var profile = new FirefoxProfile();

// create the capabilities
var capabilities = DesiredCapabilities.Firefox();
capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, profile.ToBase64String());

// start the remote driver
IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities);
Florent B.
  • 41,537
  • 7
  • 86
  • 101
  • thx I just found it too! However what would be the property to have it not ask for certificate? Where can I find a list of the preferences I can set in the profile? – Maxime Joyal May 20 '16 at 17:29
  • type `about:config` in the address bar to get all the preferences. – Florent B. May 20 '16 at 17:30
  • and for the certificate, I would try `profile.AcceptUntrustedCertificates = True;` – Florent B. May 20 '16 at 17:32
  • thx a lot for your answer!! I'm gonna look in the configs. the certificates work, now all I have is that it tells me my connection is not secure (I use a proxy). – Maxime Joyal May 20 '16 at 17:38