【发布时间】:2015-09-23 15:56:46
【问题描述】:
希望同时加载 DesiredCapabilities 和 FirefoxProfile,无法弄清楚,也找不到答案
【问题讨论】:
希望同时加载 DesiredCapabilities 和 FirefoxProfile,无法弄清楚,也找不到答案
【问题讨论】:
RemoteWebDriver 有FirefoxDriver.PROFILE 功能。
例如,
FirefoxProfile yourProfile = new FirefoxProfile("path_to_your_profile");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, yourProfile);
【讨论】:
创建您的 Firefox 配置文件,即:“profileFF”
DesiredCapabilities cap = new DesiredCapabilities();
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("profileFF");
cap.setCapability(FirefoxDriver.PROFILE, myprofile );
或
DesiredCapabilities cap = new DesiredCapabilities();
File firefoxProfileFolder = new File("/path/to/your/firefox/profile/profileFF");
FirefoxProfile myprofile = new FirefoxProfile(firefoxProfileFolder);
cap.setCapability(FirefoxDriver.PROFILE, myprofile );
【讨论】: