在Chrome上弹出处理窗口身份验证

Poo*_*try 6 selenium webdriver autoit selenium-webdriver

我正在尝试使用AutoIt处理我的Selenium webdriver脚本的基本身份验证弹出窗口.我为Firefox和Internet Explorer编写了一个脚本,但它不适用于Chrome.

当我尝试使用AutoIt窗口信息工具识别Chrome上的身份验证时,它显示为空.我正在使用以下AutoIt脚本:

WinWaitActive("Authentication Required","","120")
If WinExists("Authentication Required") Then
    Send("username{TAB}")
    Send("password{Enter}")
EndIf
Run Code Online (Sandbox Code Playgroud)

任何使这个工作的指针都会有所帮助.我没有使用, username@password:google.com因为重定向会出现一些身份验证弹出窗口.

Poo*_*try 3

我能够让 AutoIt 通过文本而不是窗口标题来定位窗口。AutoIt 窗口信息工具无法识别标题,但它确实识别了可见文本。

所以我将脚本更改为:

WinWaitActive("","Authentication Required","120")
If WinExists("","Authentication Required") Then
    Send("username{TAB}")
    Send("password{Enter}")
EndIf
Run Code Online (Sandbox Code Playgroud)

效果很好。


归档时间:

查看次数:

13426 次

最近记录:

7 年,10 月 前