英文:
Use custom profile on Zalenium to enable DRM
问题
我正在尝试为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(new URL("http://localhost:4444/wd/hub"), firefoxOptions);
这种方式无法在Zalenium上启动测试视频,而且会卡住。这是创建远程驱动程序的正确方式吗?我使用自定义配置文件的原因是我希望在启动测试时启用DRM,因为测试会显示视频。
英文:
I am trying to create a custom firefox profile for a remote driver for a Selenium test. Technologies used:
-
Written in Java
-
Zalenium link-to-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);
This does not start the tests videos on Zalenium at all, but hangs.
Is this the correct way to create the remote driver? The reason why im using the custom profile is because I want to have DRM enabled when starting the tests,as the tests display videos
答案1
得分: 1
终于找到了在远程驱动程序上启用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);
英文:
Finally found the solution to enable DRM on the remote driver
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);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论