我尝试使用Firefox模板来指定prefs.js文件中的一些参数。 我用两种场景问题与配置文件模板硒服务器
测试与webdriver的 代码:
FirefoxProfile配置=新FirefoxProfile(新文件( “/ home/user中/ selenium.default”)); driver = new FirefoxDriver(profile);
结果:按预期工作
与remoteWebDriver步骤
测试:
启动硒服务器
java -jar selenium-server-standalo-2.19.0.jar -trustAllSSLCertificates -firefoxProfileTemplate /home/user/selenium.default/ -Dwebdriver.firefox.bin=/home/user/Apps/firefox/firefox
代码在客户端
DesiredCapabilities cap = DesiredCapabilities.firefox(); driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);
结果:浏览器启动,但不执行pref.js中指定的设置。所以,不要从指定目录加载配置文件。
是否有人在selenium服务器中使用profileTemplate成功?