Discussion:
[selenium-users] profile.setPreference("browser.link.open_newwindow", 3); erroe
Archit Goel
2016-05-13 10:17:00 UTC
Permalink
in need to use something like this to open link in new tab
profile.setPreference("browser.link.open_newwindow", 3);

but getting below error
Exception in thread "main" java.lang.IllegalArgumentException: Preference
browser.link.open_newwindow may not be overridden: frozen value=2,
requested value=3

how to overcome this ?
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2a4163a4-32a4-4866-b292-e0c130aaa370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
⇜Krishnan Mahadevan⇝
2016-05-13 12:14:46 UTC
Permalink
@Archit,
This is because by design [ I use the word "by design" because I dont know
the repercussions of fiddling around with configurations which are deemed
as "change it only if you know what you are doing" and also because I don't
know the reasons behind why the selenium dev community decided this to be
so ]

The list of preferences that are supposed to be locked out and not
available for end-user to change are available here
<https://github.com/SeleniumHQ/selenium/blob/master/javascript/firefox-driver/webdriver.json>

These preferences are being bundled as webdriver_prefs.json at build time
and then embedded into the Selenium jars.

FirefoxProfile.java
<https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java#L52>
basically reads this embedded json file to figure out which preference can
be altered by the user and which cannot.

Looking at the code, I think it was decided so because, webdriver is
playing the role of a guardian and prohibiting you from doing what it
thinks will cause revocable damage to the firefox browser spawned via code
and maybe even for your manual usage.

The preference that you are setting, is part of this
<https://github.com/SeleniumHQ/selenium/blob/master/javascript/firefox-driver/webdriver.json#L10>black
list.

So you CANNOT overcome this [ There are ways to get past this, but I don't
think I should be sharing that information because I have come to respect
the decisions made by the core selenium dev community. So if they are
barring me from changing something, then am pretty sure, there must be a
very good reason for them doing so]

@Andreas,
Maybe you or someone from the core dev could explain the repercussions of
altering the black-listed preferences.




Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening
or in love with someone else!"
Post by Archit Goel
in need to use something like this to open link in new tab
profile.setPreference("browser.link.open_newwindow", 3);
but getting below error
Exception in thread "main" java.lang.IllegalArgumentException: Preference
browser.link.open_newwindow may not be overridden: frozen value=2,
requested value=3
how to overcome this ?
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/2a4163a4-32a4-4866-b292-e0c130aaa370%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/2a4163a4-32a4-4866-b292-e0c130aaa370%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkKDGM2kpxnwJR-%2Bfmg4R64Q6%2Bjmsm%3DcFQ4-SF7sa%2BG7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Archit Goel
2016-05-13 17:04:27 UTC
Permalink
@Andreas,@Krishnan
Yeah I also checked the same that above error is because
"browser.link.open_newwindow": 2, is frozen in JSON.
Now for whatsoever reason the community made it as frozen , I also respect
the decision because it might be for some purpose.

Now I just want to know that working with tabs or Opening a new tab for a
link in Firefox is still a limitation for selenium , if yes then will it be
overcome in upcoming versions ?
Post by ⇜Krishnan Mahadevan⇝
@Archit,
This is because by design [ I use the word "by design" because I dont know
the repercussions of fiddling around with configurations which are deemed
as "change it only if you know what you are doing" and also because I don't
know the reasons behind why the selenium dev community decided this to be
so ]
The list of preferences that are supposed to be locked out and not
available for end-user to change are available here
<https://github.com/SeleniumHQ/selenium/blob/master/javascript/firefox-driver/webdriver.json>
These preferences are being bundled as webdriver_prefs.json at build time
and then embedded into the Selenium jars.
FirefoxProfile.java
<https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java#L52>
basically reads this embedded json file to figure out which preference can
be altered by the user and which cannot.
Looking at the code, I think it was decided so because, webdriver is
playing the role of a guardian and prohibiting you from doing what it
thinks will cause revocable damage to the firefox browser spawned via code
and maybe even for your manual usage.
The preference that you are setting, is part of this
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FSeleniumHQ%2Fselenium%2Fblob%2Fmaster%2Fjavascript%2Ffirefox-driver%2Fwebdriver.json%23L10&sa=D&sntz=1&usg=AFQjCNFxO6HO1TEZS-IZ5zEvROQM6wCxgw>black
list.
So you CANNOT overcome this [ There are ways to get past this, but I don't
think I should be sharing that information because I have come to respect
the decisions made by the core selenium dev community. So if they are
barring me from changing something, then am pretty sure, there must be a
very good reason for them doing so]
@Andreas,
Maybe you or someone from the core dev could explain the repercussions of
altering the black-listed preferences.
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening
or in love with someone else!"
Post by Archit Goel
in need to use something like this to open link in new tab
profile.setPreference("browser.link.open_newwindow", 3);
but getting below error
Exception in thread "main" java.lang.IllegalArgumentException: Preference
browser.link.open_newwindow may not be overridden: frozen value=2,
requested value=3
how to overcome this ?
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/2a4163a4-32a4-4866-b292-e0c130aaa370%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/2a4163a4-32a4-4866-b292-e0c130aaa370%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/809ee8c0-7a86-4842-aa25-498ee954c110%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...