[英]How to handle authentication popup with Selenium WebDriver in Java
[英]How to handle a popup window that does not exist in the WebDriver with Selenium/Java?
嘗試使用在 URL 請求中發送用戶名和密碼的方法:
http://username:password@the-site.com
用戶名是username
,密碼是password
,rest是web頁面的URL
String URL = "http://" + username + ":" + password + "@" + theWebPageUrl;
driver.get(URL);
更詳細的答案在這里
如果您使用 Selenium 4,看看這個,可能值得嘗試 - https://www.lambdatest.com/blog/handling-login-popup-in-selenium-webdriver-using-java/
尤其是這一節
使用 Selenium 4 beta 版本處理 Selenium WebDriver 中的登錄彈出窗口
嘗試使用RPA.Desktop.Desktop api 或RPA.Desktop.Windows api 作為應用程序元素(瀏覽器)訪問彈出窗口。對於 Python,它是pip install rpaframework
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.