相关疑难解决方法(0)

如何使用Java使用Selenium WebDriver在Chrome中处理身份验证弹出窗口

我正在尝试在我的一个新的Webdriver脚本中处理身份验证弹出窗口.我有一个适用于IE的工作解决方案,但我正在努力使用Chrome.IE就像遵循[本页]上的建议一样简单:如何使用Java处理Selenium WebDriver的身份验证弹出窗口.该线程并没有为Chrome提供一个很好的解决方案,尽管有几位评论员指出,该解决方案不适用于Chrome.问题是,当您尝试在Chrome上执行以下代码时,登录弹出窗口不是警报.

 WebDriverWait wait = new WebDriverWait(driver, 10);      
 Alert alert = wait.until(ExpectedConditions.alertIsPresent());     
 alert.authenticateUsing(new UserAndPassword(**username**, **password**));
Run Code Online (Sandbox Code Playgroud)

它不是一个windows level()认证弹出窗口,网页只是受密码保护.我知道Stack Overflow上有这个问题的其他几个例子,但我最近没有看到比2岁更多.我希望2017年有更好的解决方案.提前感谢.

java authentication selenium google-chrome selenium-webdriver

11
推荐指数
3
解决办法
2万
查看次数

权限“<all_urls>”未知或 URL 模式格式错误

我是扩展开发的新手,
我尝试使用权限 url,因为 "<all_urls> "*" "http://*/*", "https://*/*" 没有任何模式有效

完整清单:

{
  "name": "Info",
  "description": "BS System Info",
  "version": "1.0",
  "manifest_version": 3,
  "background": {
    "service_worker": "background.js"
  },
  "content_scripts": [{
    "js": ["script.js"],
    "matches": ["http://*/*","https://*/*","<all_urls>"],
    "css" : []
}],
  "permissions": [
    "storage",
    "activeTab",
    "system.cpu",
    "system.memory",
    "system.storage",
    "system.display",
    "tabs",
    "scripting",
    "http://*/*", "https://*/*", "chrome-devtools://*/*"
],
  "action": {
    "default_popup": "index.html",
    "default_icon": {
        "16": "/images/icon_16.png",
        "32": "/images/icon_32.png",
        "48": "/images/icon_48.png",
        "128":"/images/icon_128.png"
      }
  }
}
Run Code Online (Sandbox Code Playgroud)

malformedurlexception google-chrome-extension

4
推荐指数
1
解决办法
1574
查看次数