I have been researching about how to bypass browser authentication in Safari 10 (or Chrome) in Mac OS Sierra. I have tried the following: http://username:password@URLofAPP
I have also tried: alert.SetAuthenticationCredentials(username,password); alert.accept();
and it won't work. Currently using Selenium 3.3 and Safari 10
1
-
Why you are trying to bypass it? You have selenium, you can simulate user logging in. – Peter M. - stands for Monica Sep 15 '17 at 20:00
-
I am not sure how to get into the browser alert authentication that safari is throwing. I have done some steps to do it which is the alert.setauthenticationcredentials but I couldn't get into it – Marj Sep 15 '17 at 21:20
-
Simulate exactly what user does to login to your website: go to URL, fill login form, submit. Is your website different? – Peter M. - stands for Monica Sep 15 '17 at 21:36
-
I am talking about the basic auth on browser level, not the app itself @peter – Marj Sep 16 '17 at 14:22
2
It can't be done in Selenium (outside of Java's Robot class), but you can configure your test system(s) to login using Apple's Keychain as this SuperUser answer points out. As a follow up answer points out, you can do wildcard matches on the domains now.
-
I was looking at Applescript where I can just call this method and so when my code detects it is a safari browser I'm testing, the applescript is automatically executed – Marj Sep 19 '17 at 15:41