Niclas
Niclas

Reputation: 27

Protractor - how to handle pop-up from Chrome

I am using Protractor and I'm wondering how to handle this pop-up from Chrome. I want to click the button "Open magnet URI". Check out the picture to see what I mean.

picture of pop-up

When the button is being clicked an external program will start.

I have tried with browser.switchTo().alert().accept();

But I always get "no such alert".

Can someone please help me?

Upvotes: 0

Views: 1192

Answers (3)

Aishwarya Vatsa
Aishwarya Vatsa

Reputation: 1

As per new chrome drivers disable-infobars is not working. Add following to make it work in your chrome options:

'excludeSwitches': ['enable-automation'],
'useAutomationExtension': false

Upvotes: 0

Niclas
Niclas

Reputation: 27

Thank you for an answer

I just found a solution for my problem

Added this to my config

  capabilities: {
    'browserName': 'chrome',
    chromeOptions: {
      args: [
        '--window-size=375,667',         //'--headless', '--disable-gpu',
        'disable-infobars',
      ],
      'prefs': {
        protocol_handler: {
          excluded_schemes: {
            'bankid': false
          }
        }
        }
    }
    }, 

Upvotes: 1

Madhan Raj
Madhan Raj

Reputation: 1442

Try with the below chrome option in your config

capabilities: {
    browserName: 'chrome',
    chromeOptions: {
        // disable "chrome pop-up"
        'args': ['disable-infobars=true','--disable-popup-blocking'], 

        // disable Password manager popup
        'prefs': {
            'credentials_enable_service': false
        }
    }
},

Hope it hleps you

Upvotes: 1

Related Questions