簡體   English   中英

使用Selenium Webdriver進行多重身份驗證

[英]Multiple Authentication with Selenium webdriver

我正在使用Selenium WebDriver訪問網站。 driver.get(“ http:// user:password @ samplewebsite ”);

訪問該站點需要兩個身份驗證。 自從我給用戶提供密碼后,首次身份驗證就可以工作:password @ samplewebsite

但是第二個身份驗證彈出窗口用於另一個站點。 例如: https:// samplesite2

如何處理此多重身份驗證問題。

有人可以讓我知道是否有解決此類問題的方法。

您是否嘗試過Alert中的alert.authenticateUsing()方法。 希望對您有幫助。

您可能還會看到以下鏈接:

Webdriver-HTTP驗證對話框

對於我的解決方案,如果有兩個身份驗證。

首先驗證第二個。

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

然后調用所需的URL。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM