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

Opening default browser profile #321

Closed
bmayen opened this issue Oct 15, 2014 · 7 comments
Closed

Opening default browser profile #321

bmayen opened this issue Oct 15, 2014 · 7 comments

Comments

@bmayen
Copy link

bmayen commented Oct 15, 2014

I'm trying to test a page that uses some browser extensions and plugins. However, the browser instance that Webdriverio opens has all extensions removed by default and my tests fail. In Chrome I've tried passing --user-data-dir to chromeOptions to load the default profile, but while chrome://version/ verifies that the profile loaded, there seem to be a bunch of command line options that override that and my extensions are still gone. In Firefox my extensions are removed and all plugins are set to "Ask to Activate". Is there a workaround for this?

@christian-bromann
Copy link
Member

I've once added a Chrome extension via chromeOptions.extensions. Maybe you could try to encrypt your extensions in base64 and do it the same way. Other than that I've no further experience with extension in Selenium and I've never tried to load an existing user profile. How do you set your desired capabilities?

@bmayen
Copy link
Author

bmayen commented Oct 15, 2014

This affects plugins as well though. For instance, if I want to test that an HTML5 video fallback player is working, it will be disabled by default. I'm just trying to load the default profile, not a separate user profile but it seems that webdriver is setting custom flags to disable plugins and extensions. Any idea how to simply open the browser with default settings?

@christian-bromann
Copy link
Member

mhm .. if flags aren't working, I am out of ideas. Never had this use case. Could you explain me your situation a little bit more in detail. I still don't quite understand what's the extension role here?

@bmayen
Copy link
Author

bmayen commented Oct 27, 2014

I suspect this is more of a Selenium issue than a WebdriverIO issue now. But I’ll add a little more info here to be clear.

I would like to test that an HTML5 video polyfill falls back to, say, Flash and features still work correctly if certain conditions are/aren't met. The default profile blocks Flash from loading at all though, so these tests will always fail.

On Oct 27, 2014, at 1:48 PM, Christian Bromann notifications@github.com wrote:

mhm .. if flags aren't working, I am out of ideas. Never had this use case. Could you explain me your situation a little bit more in detail. I still don't quite understand what's the extension role here?


Reply to this email directly or view it on GitHub.

@matthieugayon
Copy link

if it can help , I could load an extension like that :

desiredCapabilities: {
                    browserName: 'chrome',
                    "chromeOptions": {
                        "args": [
                            "load-extension="+__dirname+"/test/extensions/adblock",
                            "lang=de-DE","window-size=1280,800"]
                    }
                }

the extension path pointing to the uncompressed adblock chrome extension ( which I found in the google OS X application support directory on my machine )

@ghost
Copy link

ghost commented Dec 19, 2014

For me everything is working. I think this is also affected by a full stack of technologies that you are using. Mine stack is creating a new profile each test execution and delete it after. It's easy to see what's happening just looking the processes while running selenium, it will be variable pathed to selenium-x-x-x.jar .

@christian-bromann
Copy link
Member

Closing as this is more an issue of Selenium then WebdriverIO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants