【问题标题】:AutoIT Script to Handle Chrome Authentication Window用于处理 Chrome 身份验证窗口的 AutoIT 脚本
【发布时间】: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


【解决方案1】:

(这在 cmets 中已解决,但我将这里的答案复制给未来的读者。)

WinWaitActive 命令似乎永远找不到您正在寻找的登录提示。在 Windows 7 上的 Chrome 40 上,登录提示的唯一可见文本是 Chrome Legacy Window,而不是 Authentication Required(这是您要查找的内容)。

我建议使用 AutoIt 标配的“AutoIt Window Info”工具进行检查。打开 Chrome 身份验证框,冻结窗口信息工具,然后检查“可见文本”选项卡。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-11
    • 2017-01-29
    相关资源
    最近更新 更多