使用自定义配置文件在 Zalenium 上启用数字版权管理(DRM)。

huangapple go评论75阅读模式
英文:

Use custom profile on Zalenium to enable DRM

问题

我正在尝试为Selenium测试创建一个自定义的Firefox配置文件,用于远程驱动程序。所使用的技术包括:

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);

huangapple
  • 本文由 发表于 2020年4月7日 17:07:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/61076449.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定