0

Recently in our application we have added the Certification authentication and when ever we access the application the authentication pop-up is displayed and we have to select the correct authentication and click on the Ok button. I tried looking for solutions to use in protractor, but no luck. I have attached the SS of my window. When I use the below code I am getting only 1 windowhandler.

I would appreciate your help as my scripts failing due to this issue.

flow = protractor.promise.controlFlow();
  flow.execute(function () {
   browser.ignoreSynchronization = true;
   browser.get('https://test.xyz.net/').then(function () {
     browser.driver.getAllWindowHandles().then(function (handles) {
      console.log (handles.length);
     })
   })
   browser.ignoreSynchronization = false;
   });

enter image description here

Luca Kiebel
  • 9,790
  • 7
  • 29
  • 44
Vin
  • 165
  • 2
  • 12
  • That dialog is controlled view the browser, I don't think you can control that from your code. – Adam H Sep 14 '18 at 18:43
  • Do you mean there's no way to do action on that pop-up using my code? – Vin Sep 14 '18 at 19:00
  • I read in some article that the pop up comes up when there is more than one option. When there is only one there should be a setting in the browser for it to select it directly. – Juan Sep 14 '18 at 19:03
  • @Vin Yes, the pop up is coming from the browser (Chrome, IE, Safari etc.) and you can't control it. – Adam H Sep 14 '18 at 19:12
  • Please visit below link, it might help you : https://sqa.stackexchange.com/questions/7640/how-to-select-security-certificate-from-security-dialog – SGT Sep 17 '18 at 07:20
  • You have to set the browser option to accept the certificate. In configuration file, under capabilities, use the following : acceptInsecureCerts : true, – Avinash Sep 17 '18 at 14:19
  • @Avinash Where should I mention that command in my config file. Is that within chromeOptions: args. I tried both in chromeOptions and outside of it. But I am getting error cannot parse capability: acceptInsecureCerts. If i use with in the chromeOptions then the cert is not ignored when I run the script. `capabilities: { 'browserName': 'chrome', 'acceptInsecureCerts': 'true', 'acceptSslCerts': 'true', chromeOptions: { args: ['start-maximized', 'show-fps-counter=true'] },` – Vin Sep 17 '18 at 16:10
  • 1
    Want to update on this issue, Finally I am able to fix the issue. Many thanks for everyone here. I used the method mentioned in this ticket https://gist.github.com/IngussNeilands/3bbbb7d78954c85e2e988cf3bfec7caa and also I have added the key in my registry as Software\Policies\Google\Chromium\AutoSelectCertificateForUrls\1 = "{"pattern":"*.example.net","filter":{"ISSUER":{"CN":"example"}}}" – Vin Sep 17 '18 at 16:26

0 Answers0