簡體   English   中英

如何使用帶有Java的Selenium Webdriver處理允許彈出的Firefox插件

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM