[英]How do I handle allow pop-up of plug-in for firefox using Selenium Webdriver with Java
同时自动化包含Vidyo Web播放器插件的网页。 如果我导航到“视频”页面,则显示“允许”弹出窗口。 我试图用下面的代码来处理允许弹出窗口。 但这不起作用。
下面是正在使用的代码,
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("security.mixed_content.block_active_content", true);
profile.setPreference("security.mixed_content.block_display_content", false);
WebDriver driver = new FirefoxDriver(profile);
有人可以帮忙吗?
提前致谢。
引用此答案,您可能需要为扩展名获取文件并使用以下命令:
File file = new File("path to extension file");
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(file);
WebDriver driver = new FirefoxDriver(profile);
这个首选项如何:
FirefoxProfile profile= new FirefoxProfile();
profile.setPreference(“browser.popups.showPopupBlocker”, false);
WebDriver driver = new FirefoxDriver(profile);
尝试设置此首选项以摆脱“允许” /“继续阻止”:
profile.setPreference("plugin.scan.plid.all", false);
另外,您可能需要使用它来自动允许扩展
profile.setPreference("extensions.blocklist.enabled", false);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.