在Selenium Java中需要这些(Firefox)浏览器配置文件设置的chrome等价物

时间:2015-08-25 13:24:08

标签: java google-chrome selenium

我使用Chrome浏览器一直在使用Selenium Java WebDriver,到目前为止取得了相当大的成功。我已经能够启动chrome窗口并发送和接收数据就好了。我现在需要弄清楚Firefox浏览器的以下配置文件设置的chrome等价物。

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.download.folderList", 2);
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "image/jpg");
profile.setPreference("browser.download.dir", "path/to/downloads/pics/folder");

计划做这样的事情(参考:https://sites.google.com/a/chromium.org/chromedriver/capabilities),但需要像上面那样设置其他属性。

ChromeOptions chromeOptions = new ChromeOptions();
//set the rest of the preferences for chrome as shown above for Firefox
  • 硒:2.47.1
  • Mac:OsX Yosemite
  • ChromeDriver:2.18
  • JDK:1.8x

感谢。

1 个答案:

答案 0 :(得分:2)

试试这个:

system.activate( "multitouch" )
相关问题