小编典典

使用Selenium处理浏览器身份验证

selenium

有谁知道在自动化过程中使用Selenium或任何其他工具来处理浏览器身份验证吗?


阅读 337

收藏
2020-06-26

共1个答案

小编典典

警报方法authenticateUsing() 使您可以跳过“ Http基本身份验证”框。

WebDriverWait wait = new WebDriverWait(driver, 10);      
Alert alert = wait.until(ExpectedConditions.alertIsPresent());     
alert.authenticateUsing(new UserAndPassword(username, password));

从Selenium 3.4开始,它仍处于测试阶段
现在,仅针对 InternetExplorerDriver

2020-06-26