【发布时间】:2019-07-24 23:45:37
【问题描述】:
我正在使用 watir(Ruby selenium 包)尝试使用基本身份验证登录到 url
我这样传递凭据
https://username:password@nagios.com
但是,当浏览器打开时,我会弹出一个窗口以再次输入凭据。
我使用的代码如下
driver = Watir::Browser.new :chrome
driver.goto "https://username:password@nagios.com"
上面的代码打开浏览器 -> 转到 url 但弹出窗口再次输入凭据。
如何使用基本身份验证登录 url?
【问题讨论】:
-
什么浏览器?站点或驱动程序目前可能不支持基本身份验证。
标签: authentication selenium-webdriver basic-authentication watir