我正在使用 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)
但我的问题是网络驱动程序窗口没有位于所有其他窗口之上,因此我无法使用机器人对象在确切位置复制用户名和密码。
提前致谢
最佳答案
您可以使用 AutoIT 来自动化窗口对话框,并且对于您的场景,您实际上也可以将特定窗口置于焦点中。
这是一个reference ,但是有很多关于这个主题的帖子。
关于java - 如何控制 selenium Web 驱动程序浏览器窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20500391/