【发布时间】:2016-11-25 15:12:42
【问题描述】:
我正在使用 java selenium web 驱动程序为网站开发自动化脚本。
但该网站两次请求“需要身份验证”(窗口)。
我通过修改 URL 处理了第一个“需要身份验证”窗口,如下所示
http://username:password@thaturl.com
但要处理第二个“Windows 身份验证”,我依赖于多处理。
我为处理第二个“需要身份验证”窗口做了以下操作
Whenever the browser got stucks at "Authentication required" window, then I will be
starting a small http server and opening a url, that opened url will type the username
and password in the "Authentication required" window ( i.e. I am triggering another
process through a url by creating handler for that url which will copy username and
password in the "Authentication Required" window)
但我的问题是网络驱动程序窗口没有在所有其他窗口之上,所以我无法使用机器人对象在确切位置复制用户名和密码。
提前致谢
【问题讨论】:
-
你为什么使用机器人?没有办法引用用户/通行证字段?例如,也许这是一个 flash 或 java 小程序或 selenium 确实不支持的东西。
-
用于执行“ctrl v”,将用户名和密码复制到框中
-
窗口看起来像下面的链接stackoverflow.com/questions/12151958/…。
-
我可以得到任何替代来避免机器人对象吗?
标签: java selenium selenium-webdriver