在Selenium Java中需要这些(Firefox)浏览器配置文件设置的chrome等价物
我一直在玩使用chrome浏览器的SeleniumJavaWebDriver,到目前为止已经取得了相当大的成功。我已经能够启动chrome窗口并发送和接收数据。我现在需要为Firefox浏览器找出与以下配置文件设置相同的chrome浏览器在Selenium Java中需要这些(Firefox)浏览器配置文件设置的chrome等价物,java,google-chrome,selenium,Java,Google Chrome,Selenium,我一直在玩使用chrome浏览器的SeleniumJavaWebDriver,到目前为止已经取得了相当大的成功。我已经能够启动chrome窗口并发送和接收数据。我现在需要为Firefox浏览器找出与以下配置文件设置相同的chrome浏览器 FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.folderList", 2); profile.setPreference("bro
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");
计划这样做(参考:),但需要如上所述设置其他属性
ChromeOptions chromeOptions = new ChromeOptions();
//set the rest of the preferences for chrome as shown above for Firefox
- 硒:2.47.1
- Mac:OsX约塞米蒂
- 色度驱动器:2.18
- JDK:1.8x
ChromeOptions options = new ChromeOptions();
options.addArguments("--browser.download.folderList=2");
options.addArguments("--browser.helperApps.neverAsk.saveToDisk=image/jpg");
options.addArguments("--browser.download.dir=path/to/downloads/pics/folder");
driver = new ChromeDriver(options);
复制品?谢谢Shubhasmit,我很快就会试试这个。接受答案。你能在引用这些选项的文档中添加一个链接吗?