Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Not possible to Set Chrome Browser Locale via desiredCapabilities, browserOptions #15

Closed
wolczyk opened this issue Oct 11, 2017 · 6 comments
Assignees

Comments

@wolczyk
Copy link

wolczyk commented Oct 11, 2017

I'm unable to pass Chrome Locale via Desired Capabilities nor Browser Options.
I noticed in the code that Desired capabilities for Chrome are not affected by parameters sent in Open Browser keyword call - not implemented.

I made it work by small code change (shown below) in createDesiredCapabilities method.

ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("intl.accept_languages", "de-AT");
options.setExperimentalOption("prefs", prefs);
desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, options);

Is there any workaround or plan for change?

@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Oct 11, 2017

This can be implemented to next version, and probably to both Selenium2 and 3 sides.

@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Oct 11, 2017

Isn't this just matter of putting values? The example would e.g. be:

{"chromeOptions": {"intl.accept_languages": "de-AT"}}

or

{"chromeOptions": {"prefs": {"intl.accept_languages": "de-AT"}}}

@wolczyk
Copy link
Author

wolczyk commented Oct 11, 2017

I've got serialized ChromeOptions in JSON in the following form
{"args":[],"extensions":[],"prefs":{"intl.accept_languages":"de-AT"}}

Today, BrowserManagement class contains only call
desiredCapabilities = DesiredCapabilities.chrome();

I think similar method to 'parseBrowserOptionsFirefox' would make it feasible to pass the options.

@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Oct 11, 2017

I think that I need to refactor that part a bit in general, as browser is only getting desired capabilities (or Options in Selenium 3). So no browser specific things, just common parsing functions.

@Hi-Fi Hi-Fi self-assigned this Oct 11, 2017
Hi-Fi added a commit that referenced this issue Oct 14, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Relates to #15
@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Oct 14, 2017

Fixed in

  • 2.53.1.2
  • 3.5.3.2

@Hi-Fi Hi-Fi closed this as completed Oct 14, 2017
@wolczyk
Copy link
Author

wolczyk commented Oct 16, 2017

Thanks Juho, 2.53.1.2 works for me!

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

2 participants