我正试图为Selenium测试的远程驱动程序创建一个自定义的firefox配置文件。使用的技术:
- 用Java编写
-
Zalenium连接至Zalenium
File profileDirectory = new File("path-to-firefox-profile"); FirefoxProfile profile = new FirefoxProfile(profileDirectory); FirefoxOptions firefoxOptions = new FirefoxOptions(); firefoxOptions.setProfile(profile); WebDriver driver = new RemoteWebDriver(http://localhost:4444/wd/hub, firefoxOptions);
这根本不会启动Zalenium上的测试视频,而是挂起。这是创建远程驱动程序的正确方法吗?我之所以使用自定义配置文件,是因为我希望在开始测试时启用DRM,因为测试显示视频
终于找到了在远程驱动程序上启用DRM的解决方案
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.addPreference("media.eme.enabled",true);
firefoxOptions.addPreference("media.gmp-manager.updateEnabled", true);
driver = new RemoteWebDriver("http://grid:4444/wd/hub", firefoxOptions);