A very simple syntax to handle the browser based authentication,
If we have username and password and the URL then requested URL will be,
http://username:password@domainName.com
Note that we have a special character colon “:” between username and password.
For example, we have
username : abcSo the Selenium Webdriver command to open application in a browser,
password : abc123
URL : xyz.com
then the requested URL for Selenium Webdriver command,
abc:abc123@xyz.com
(C#)
driver.Navigate().GoToUrl("http://abc:abc123@xyz.com/");
(Java)
driver.get("http://abc:abc123@xyz.com/");
Thank you…..
Enjoy automated testing using Selenium Webdriver….!!!
No comments:
Post a Comment