Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to launch firefox 48 with custom profile using Geckodriver #2645

Closed
furqanmlk opened this issue Aug 22, 2016 · 20 comments
Closed

Unable to launch firefox 48 with custom profile using Geckodriver #2645

furqanmlk opened this issue Aug 22, 2016 · 20 comments

Comments

@furqanmlk
Copy link

furqanmlk commented Aug 22, 2016

Meta -

OS: Win 10 x64

Selenium Version:
3.0
Browser:
Firefox

Browser Version:

Firefox 48.0.1

Expected Behavior -

geckoriver should launch Firefox48 with custom profile

Actual Behavior -

geckodriver still launches Firefox with new profile

Steps 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);

@furqanmlk furqanmlk changed the title Unable to launch firefox 48 default profile using Geckodriver Unable to launch firefox 48 custom / default profile using Geckodriver Aug 23, 2016
@furqanmlk furqanmlk changed the title Unable to launch firefox 48 custom / default profile using Geckodriver Unable to launch firefox 48 with custom profile using Geckodriver Aug 24, 2016
@jbgomond
Copy link

I can confirm the issue, I have the same problem and tried everything without any success ...

@everyx
Copy link

everyx commented Aug 25, 2016

The same problem

@borginek
Copy link

Agree. It doesn't work :(

@Sn0wBiT
Copy link

Sn0wBiT commented Aug 29, 2016

Same problem too.

@furqanmlk
Copy link
Author

does anyone know how to escalate this issue ?

@Scr34mik
Copy link

Scr34mik commented Aug 31, 2016

With v3.0.0b2 and geckodriver 0.10, I was able to do so with following code (sorry im using vb.net, ull have to convert it yourself)

    Dim FirefoxSrvc As FirefoxDriverService = FirefoxDriverService.CreateDefaultService()
    FirefoxSrvc.FirefoxBinaryPath = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
    FirefoxSrvc.HideCommandPromptWindow = True

    Dim FirefoxOpts = New FirefoxOptions
    Dim FFLocalProfile As FirefoxProfile = New FirefoxProfile("C:\ff\joeluser")
    FirefoxOpts.Profile = FFLocalProfile

    driver = New FirefoxDriver(FirefoxSrvc, FirefoxOpts, New System.TimeSpan(0, 0, 60))

Hope this helps !

@furqanmlk
Copy link
Author

furqanmlk commented Aug 31, 2016

Thanks Scr34mik for your help,

Unfortunately, I am getting error "corrupt deflate stream" at ,
driver = New FirefoxDriver(FirefoxSrvc, FirefoxOpts, New System.TimeSpan(0, 0, 60))

if profile is converted to Base64String
Then it launches Firefox with new profile not desired profile

@dtext
Copy link

dtext commented Sep 12, 2016

I can also confirm this issue. Looking for a long term solution to be able to use firefox for GUI tests.

@everyx
Copy link

everyx commented Sep 12, 2016

I found that we can use https://github.com/mozilla/geckodriver/releases/tag/v0.7.1 then follow https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver step by step.

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
caps["binary"] = settings.FIREFOX_PATH
driver = webdriver.Firefox(capabilities=caps)

It just work :)

@iKarthik
Copy link

I get a similar error, when I try to launch custom profile with Selenium
Environment
Firefox 48.0.2
Geckodriver v0.10

Has there been any updates regarding this?

@titusfortner
Copy link
Member

titusfortner commented Sep 19, 2016

Yes, Geckodriver v0.11 (when it comes out) will support 'firefoxOptions' - mozilla/geckodriver#228

@iKarthik
Copy link

Is there an expected release date for v0.11?

@furqanmlk
Copy link
Author

furqanmlk commented Sep 21, 2016

Following` code is working !

FirefoxDriverServise service = FirefoxDriverService.CreateDefaultService();
FirefoxProfile profile = new FirefoxProfile();
profile.AddExtension(Path.GetFullPath("path/to/extension.xpi"));
var options = new FirefoxOption();
options.Profile = profile;
var driver = new FirefoxDriver(service,options,TimeSpan.FromMinutes(30));

@cloudhx
Copy link

cloudhx commented Oct 25, 2016

Hi furqanmlk, I tried your code but it still has the same error, I'm using the latest version for both selenium and geckodriver, could you please confirm this, thank you!

@redwards510
Copy link

redwards510 commented Nov 7, 2016

I had a working setup with 0.11.1 and a custom profile (FFv49.0.2) for days. Then I did two things that screwed it up. I upgraded my Selenium.Support Nuget from 2.53.1 to v3 (to match my installed Selenium of v3.0) and installed Mozilla Nightly. I have no idea why either of those things would make it break, but it did. I started getting the "corrupt deflate stream" errror.

I just got it to work again. I uninstalled Nightly. I then went back to my 49.0.2 mozilla and used firefox -P to create a new profile in a new directory. Set it to use that by default. Then I ran my code again, pointed to that new profile directory. It worked. So my speculation is that something in the profile itself is getting corrupted OR the Nightly installation modified my testing profile somehow. Although I thought we were supposed to be using Nightly for best results..

@couchpotatodude
Copy link

Try to remove 'user.js' file from profile directory.

@wcdeich4
Copy link

How can I use my real FireFox user profile? (The existing profile that is used when I open FireFox every day.)

The examples @furqanmlk and @Scr34mik provided are actually creating a new profile. Maybe you can reuse the created profile - but it not my real user profile.

Using the real user profile is highly advantageous b/c sometimes there are firewall popups & security questions. My real profile has already answered those questions & won't be challenged again. A profile created by Selenium will get blocked by firewall popups in the middle of the automation test.

@asrafiq
Copy link

asrafiq commented Feb 21, 2017

Older version of Firefox picked up the existing profile but now it creates a new profile for each test. can this be fixed please? The works on Chrome and IE like it did on Firefox before.

@titusfortner
Copy link
Member

Geckodriver allows you to pass in the Base64 encoded zip of a profile directory (including your default) - https://github.com/mozilla/geckodriver#firefox-capabilities

The specifics on how to generate the correct Options parameter will vary based on which language bindings you are using.

@barancev
Copy link
Member

barancev commented Sep 5, 2017

Let's suppose this issue was fixed in geckodriver 0.11 (current version is 0.18)
Feel free to reopen it if it's not true.

@barancev barancev closed this as completed Sep 5, 2017
@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests