0

Expected Behavior -

geckodriver should be able to launch Firefox48 with custom profile

Step to reproduce -

01: Zip default profile folder

02: Getting default profile location
string prof = (@"...\AppData\Roaming\Mozilla\Firefox\Profiles\6uqm9vnl.default.zip");

03: Converting to base64-encoded string
var prof1 = System.Text.Encoding.UTF8.GetBytes(prof);
var prof2 = System.Convert.ToBase64String(prof1);
FirefoxProfile profile = new FirefoxProfile(prof2);

04: Initializing FirefoxDriver
new FirefoxDriver(profile);

Actual Behavior -

geckodriver still launches new profile

Malik
  • 31
  • 4
  • Hi Automation, and welcome to Stack Overflow. Can I ask you to [edit] your question to clarify it a bit? For one thing, I'm not sure what you mean by "default profile"; and for another thing, you seem to be describing two different situations in your examples - one situation with a specified profile, and one without. Can you explain which one you're after, and in the case of the error, give more precise information about what the error is? – Vince Bowdren Aug 23 '16 at 09:33
  • Thank you so much for quick reply, I have updated the question – Malik Aug 23 '16 at 14:14
  • Small help would be appreciated – Malik Aug 30 '16 at 15:18

1 Answers1

0

I had recently similar problem - the only difference is I point to a folder with whole FF profile

The solution in my case was:
1)I created a brand new profile with all extensions/credentials etc. I need during tests
2)I create driver like following:

    var profile = new FirefoxProfile(@"C:\Gecko_Profile")
    {
        EnableNativeEvents = false
    };

    var driverService = FirefoxDriverService.CreateDefaultService();
    var options = new FirefoxOptions
    {
        Profile = profile
    };

    return new FirefoxDriver(driverService, options, TimeSpan.FromMinutes(1));

PS:Tested and working with: FF v48.0/v49.0.2/vFF50.0 + GeckoDriver v0.11.1 + WebDriver v3.0.1 PSS:GeckoDriver from nuget

Bart Wojtala
  • 1,290
  • 9
  • 7