2016-09-14 76 views

回答

5

你不能通過Selenium直接控制這種「彈出」。

你可以做的是:

  • 禁用所有推送通知爲完全在瀏覽器會話:

    FirefoxProfile ffprofile = new FirefoxProfile(); 
    ffprofile.setPreference("dom.webnotifications.enabled", false); 
    WebDriver driver = new FirefoxDriver(ffprofile); 
    
  • 負荷中,你必須預先設定的現有配置文件爲本網站的推送通知提供所需的行爲:

僅供參考,當您在瀏覽器中配置推送通知時,Firefox插入/更新permissions.sqlite SQLite數據庫文件,您可以在配置文件導向器中找到該文件年。

+0

謝謝巴迪。它的工作!做得好。 – tsivarajan

相關問題