How to make Firefox open all links opened via WebDriver in the same window?

后端 未结 6 1618
礼貌的吻别
礼貌的吻别 2021-01-04 10:23

I want to open all links in the same window instead in new window. I tried

profile.setPreference(\"browser.link.open_newwindow\", 1)

but th

6条回答
  •  爱一瞬间的悲伤
    2021-01-04 11:09

    According to Selium docs (https://code.google.com/p/selenium/wiki/FirefoxDriver) the following property webdriver.firefox.profile controls the firefox profile used.

    Which is where firefox gets the browser.link.open_newwindow on start up from. To create a new profile for your tests you can follow the instructions here https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles detailed configuration of the profile can be done either by editing the profile's pref.js or firing up the profile and editing it via about:config.

    hope this of help!

提交回复
热议问题