简体   繁体   English

Ruby Watir-webdriver配置文件切换

[英]Ruby Watir-webdriver profile switching

I am using Watir-Webdriver with Firefox profiles and I hit a bit of a snag. 我在Firefox配置文件中使用Watir-Webdriver,但遇到了一些麻烦。 I am trying to figure out I may change various profile settings on the browser without closing and reopening it. 我试图弄清楚我可能会在浏览器中更改各种配置文件设置,而无需关闭并重新打开它。 I can find all the settings in about:config but I can seem to get Watir to navigate in there correctly to set the items I want. 我可以在about:config找到所有设置,但似乎可以让Watir在其中正确导航以设置所需的项目。 Alternatively, I cannot find any documentation about reloading profiles with new configuration values while the browser is still running. 另外,当浏览器仍在运行时,我找不到任何有关使用新配置值重新加载配置文件的文档。

So my question is, how may one easily navigate the about:config page itself to change configuration settings, or reload a profile object while the browser is still running. 所以我的问题是,当浏览器仍在运行时,如何轻松浏览about:config页面本身以更改配置设置,或重新加载配置文件对象。

Alternatively the settings I am looking for can also be found in the options GUI, but I don't think Watir can manipulate that. 另外,我正在寻找的设置也可以在选项GUI中找到,但是我认为Watir不能操纵它。

Any help or tips will be appreciated. 任何帮助或提示将不胜感激。

Edit:: On a side note, if anyone sees this... is it possible to pull the current proxy ip that is used in the browser object returned from Watir::Browser.new 编辑::在旁注中,如果有人看到此信息...是否可以拉出从Watir::Browser.new返回的浏览器对象中使用的当前代理ip。

IMHO, you can modify configuration settings, but you CANNOT load different profile without restarting the browser. 恕我直言,您可以修改配置设置,但不能在不重新启动浏览器的情况下加载其他配置文件。 This is something you can't do even manually. 这是您甚至无法手动执行的操作。
Personally, I created a profile configuration once (manually), that is dedicated to tests and then I use it as it is. 我个人(一次)创建了一个配置文件配置,专用于测试,然后按原样使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM