简体   繁体   中英

Multiple Authentication with Selenium webdriver

I am using selenium webdriver to access a website. driver.get(" http://user:password@samplewebsite ");

Two authentications are required for accessing the site. First authentication works since I have given user:password@samplewebsite

But the second authentication popup is for another site. eg: https://samplesite2

How to handle this multiple authentication problem.

Could someone let me know whether there is any solution for such issues.

Did you try with alert.authenticateUsing() method in Alert. I hope it may help you.

You may see the link below too:

Webdriver - HTTP authentication dialog

For my solution, if there are two authentications.

Authenticate the second one first.

driver.get("http://user:password@samplewebsite2");

Then call the required url.

driver.get("http://user:password@samplewebsite1");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM