【问题标题】:Chrome Authentication using AutoIt - Desktop locked situation使用 AutoIt 的 Chrome 身份验证 - 桌面锁定情况
【发布时间】:2017-01-29 00:58:29
【问题描述】:

尝试使用 Autoit 处理 Chrome 的身份验证弹出窗口(“需要身份验证”)

Sceanrio -

  1. 从 chrome 导航到 URL
  2. Chrome 显示“需要身份验证”弹出窗口
  3. 输入凭据并继续

以下代码 sn-p 工作正常,除非系统/桌面处于锁定状态。任何帮助将不胜感激。

WinWait("", "Authentication Required", 10)
If WinExists("","Authentication Required") Then
 Send("username"{Tab}")
 Send("password{Enter}")
EndIf

尝试了其他选项 -

  1. Autoit WIndow 信息查找器 - 未识别 chrome 的窗口信息,如类、标题等
  2. alert.authenticateUsing() - 不起作用,因为弹出不是来自 DOM 并且它的窗口弹出
  3. driver.navigate("http://username:password@domain") - 无法在 chrome 中使用。

【问题讨论】:

    标签: java selenium automation webdriver autoit


    【解决方案1】:

    如果窗口被锁定,AutoIT 将无法工作。你可以做的是,你可以做以下事情来防止窗口被锁定

    1. 将电源选项更改为始终开启
    2. 写下一个 vbscript,它会不断发送一些键并使用 windows 调度程序对其进行调度。 How to prevent auto-locking feature of an XP machine using VBscript

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-16
      • 2019-10-04
      • 2021-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-03
      相关资源
      最近更新 更多