Not able to update the firefox preference
Hi Team ,
Am using an automation framework based on python , selenium and splinter. Usecase : I have an xpath - where the locator is href. When I find that xpath on my ui, i need to click it so that it opens up in a new tab. Problem : For firefox, the xpath with the href link opens up in a new window. Which is not as expected.
What have I tried : I tried to update the preference - ""browser.link.open_newwindow": 3
firefox_options= Options() firefox.set_preferences(browser.link.open_newwindow":,3)
The above code is updated in file firefox.py. I was able to update it locally and it runs successfully. HOwever, I do not get permisson to push to my git branch.
Please confirm how can we make this work. I understand this will require a change in LIbrary ..but not sure how to do that. SInce, we don't tha required access right.
Have you tried something like this in your test script when instantiating the browser?:
class TestSysadminTracker(unittest.TestCase):
@classmethod
def setUpClass(cls):
...
profile_preferences = {
"browser.link.open_newwindow": 2
}
cls.browser = Browser('firefox',
profile_preferences=profile_preferences,
headless=True, fullscreen=True)
cls.browser.driver.set_window_size(1280,1696)
when you set up your test class?
As of version 0.16.0, the Firefox browser now supports sending an Options object to the driver. eg:
my_options = Options()
browser = Browser(options=my_options)
great! Thankyou team! was able to make it work with the above steps.