问题
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