selenium chrome driver select certificate popup confirmation not working

后端 未结 5 869
旧时难觅i
旧时难觅i 2020-12-10 05:09

I am automating tests using selenium chromewebdriver 3.7. Whenever I lauch the site, I get a certificate selection popup like the one below

However I am not able to

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 06:05

    If still actual, I had same issue on Mac, and solution was simple:

    • for chrome is set AutoSelectCertificateForUrls policy like that:

      defaults write com.google.Chrome AutoSelectCertificateForUrls -array-add -string '{"pattern":"[*.]example.com","filter":{"ISSUER":{"CN":"**cert issuer**"}, "SUBJECT":{"CN": "**cert name**"}}}'
      
    • for safari:

      security set-identity-preference -c "**cert name**" -s "**example.com**"
      

    then use it in code like subprocess.call() in python

提交回复
热议问题