mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Cannot set browser.link.open_newwindow preference #2120

Closed Gerald94 closed 1 year ago

Gerald94 commented 1 year ago

System

In my testcase i click an link and i want that the link always opens in a new tab instead of a new window.

In my capabilites i want to set the preference:

option = new FirefoxOptions(); option.addPreference("browser.link.open_newwindow", 3);

When i execute the test i get the following error:

Preference browser.link.open_newwindow may not be overridden: frozen value=2, requested value=3

Does anybody know how to fix that?

whimboo commented 1 year ago

Could you please attach a trace-level log from geckodriver? Read more about reporting actionable bugs in our contribution guidelines.

whimboo commented 1 year ago

Actually which binding of Selenium is that? I can see references to that in the Selenium repository: https://github.com/search?q=repo%3ASeleniumHQ%2Fselenium+%22frozen+value%22&type=code

whimboo commented 1 year ago

Ok, so I think that this is a Selenium issue and that you should use Selenium 4 to get it working.

Gerald94 commented 1 year ago

Oh i think you are right. But for me it is no possible to switch to Selenium 4 now, this takes some time.

Is it somehow possible to set this preference fixed in geckodriver or firefox? As a fast workaround?

whimboo commented 1 year ago

You would have to ask the Selenium folks if there would be a workaround. Maybe use that formerly mentioned issue for that.

Gerald94 commented 1 year ago

Ah i have found the solution for it in the issue: https://github.com/SeleniumHQ/selenium/issues/5540#issuecomment-537427727

Thank you so much for the help.