【问题标题】:Dropdown selection on AHK using Chrome.ahk使用 Chrome.ahk 在 AHK 上进行下拉选择
【发布时间】:2020-10-16 02:46:50
【问题描述】:

我想了解是否可以使用带有 AHK 代码的 https://github.com/G33kDude/Chrome.ahk 选择下拉列表?

这是我的示例代码,但我无法在此处选择选项,document.getElementsByName(""cars"")[0].options[1].selected=true 适用于不过 Google Chrome 控制台。

#Include ../Chrome.ahk

FileCreateDir, ChromeProfile
ChromeInst := new Chrome("ChromeProfile")


PageInst := ChromeInst.GetPage()
PageInst.Call("Page.navigate", {"url": "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select"})
PageInst.WaitForLoad()

PageInst.Evaluate("document.getElementsByName(""cars"")[0].options[1].selected=true")

我们将不胜感激。谢谢

【问题讨论】:

    标签: selenium google-chrome autohotkey


    【解决方案1】:

    事实证明 w3schools 并不是测试代码的最佳示例......它实际上在带有下拉列表的普通网站上工作。

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-01
      • 2014-12-10
      • 1970-01-01
      相关资源
      最近更新 更多