When running tests against IE in browserstack it seems that IE is coming up with a security exception message:
This is coming up because the backend api that is being called is using a self signed cert which is untrusted (it needs to be like this for CI as the api has a different url each time CI creates the backend)
What needs to happen for this automated test to run is that the dialog needs to be accepted (or not come up at all) - but I dont see any way of doing this through the nightwatch framework.
I have tried things like, clicking the left arrow using browser.setValue('button', [browser.Keys.LEFT_ARROW]);
and also tried clicking the button with the 'Yes' value but nothing seems to work.
I have also set acceptSslCerts in my ie profile setup:
"ci_ie": {
"launch_url" : "http://hub.browserstack.com",
"selenium_port" : 80,
"selenium_host" : "hub.browserstack.com",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "ie",
"javascriptEnabled": true,
"acceptSslCerts": true,
"ignoreProtectedModeSettings": true,
"browser_version": "10",
"os_version": "7",
"os": "windows"
}
}
Any ideas on how to resolve this would be greatly appreciated.
I fixed this by adding:
"unexpectedAlertBehaviour": "accept"
to the desiredCapabilities
section in my nightwatch config.
I think it maybe due to acceptSslCerts
getting ignored for XHR requests.