2016-09-14 74 views

回答

5

你不能通过Selenium直接控制这种“弹出”。

你可以做的是:

  • 禁用所有推送通知为完全在浏览器会话:

    FirefoxProfile ffprofile = new FirefoxProfile(); 
    ffprofile.setPreference("dom.webnotifications.enabled", false); 
    WebDriver driver = new FirefoxDriver(ffprofile); 
    
  • 负荷中,你必须预先设定的现有配置文件为本网站的推送通知提供所需的行为:

仅供参考,当您在浏览器中配置推送通知时,Firefox插入/更新permissions.sqlite SQLite数据库文件,您可以在配置文件导向器中找到该文件年。

+0

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

相关问题