【发布时间】:2015-02-03 19:52:53
【问题描述】:
我有以下基于以下链接的脚本:Here
If(Not IsArray($CmdLine) Or $CmdLine[0] < 2) Then
$user = InputBox ("User", "Please enter your user", "")
$pass = InputBox ("Password", "Please enter your password", "", "*M")
Else
$user = $CmdLine[1]
$pass = $CmdLine[2]
EndIf
WinWaitActive("", "Authentication Required", "120")
If WinExists("", "Authentication Required") Then
Send($user)
Send("{TAB}")
Send($pass)
Send("{ENTER}")
EndIf
这对我不起作用,当我使用它运行测试时,用户名和密码字段中没有输入任何内容。我什至创建了一个脚本,我只是将一个字符串发送到用户名和密码字段,但它也不起作用。
【问题讨论】:
-
您等到窗口处于活动状态,然后检查它是否存在?如果删除
WinExists检查会发生什么? -
@Mr.Llama 同样的行为。绝对没有发生任何事情。
-
它是否曾经通过
WinWaitActive命令?之后尝试添加MsgBox命令以验证它是否存在。请务必检查WinWaitActive的返回值,以确认它不是来自超时。 -
我在
WinWaitActive命令之后添加了一个消息框,但也没有出现 -
那就好了。 AutoIt 没有看到身份验证窗口。我刚刚检查了 Windows 7 上的 Chrome 40,登录提示似乎有文本
Chrome Legacy Window,而不是Authentication Required。您应该咨询 AutoIt 标配的“AutoIt Window Info”工具。这很方便。
标签: google-chrome autoit