How to disable “always open these types of links in the associated app” Chrome alert

不问归期 提交于 2019-12-24 22:12:13

问题


While executing my Protractor tests in Chrome I'm getting an alert similar to below:

I want to accept it to be able to continue with my tests execution.

First I've tried with browser.switchTo().alert().accept() but it didn't work.

Then I google'd a bit and found the following solution:

chromeOptions: { 
      prefs: { 
        protocol_handler: { 
          excluded_schemes: { 
            "app": true 
          } 
        } 
      },

but it didn't work either.

I need to be able to accept that in order to execute remaining test steps.


回答1:


Try to add --disable-infobars to the config file.

  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: ['--disable-infobars']
    }
  }


来源:https://stackoverflow.com/questions/55124895/how-to-disable-always-open-these-types-of-links-in-the-associated-app-chrome-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!