【问题标题】:get value from text field in autoit从 autoit 中的文本字段获取值
【发布时间】:2014-11-02 15:55:10
【问题描述】:

我想从 Autoit 中的 swing 应用程序的文本字段中获取值以进行比较。是否有任何工具可以在浏览器中查找特定字段的 ID,例如 firebug。 Autoit 中用于提取和比较字段值的代码是什么。

【问题讨论】:

    标签: swing testing autoit


    【解决方案1】:

    来自帮助文件:

    ; *******************************************************
    ; Example 1 - Open a browser to the basic example, get an object reference
    ;               to the DIV element with the ID "line1". Display the innerText
    ;               of this element to the console.
    ; *******************************************************
    
    #include <IE.au3>
    
    Local $oIE = _IE_Example("basic")
    Local $oDiv = _IEGetObjById($oIE, "line1")
    ConsoleWrite(_IEPropertyGet($oDiv, "innertext") & @CRLF)
    

    为了得到你可以使用的价值

     _IEPropertyGet($oDiv, "value") 
    or
     $oDiv.Value
    

    【讨论】:

    • 我想在 Swing 应用程序中获取一个字段的 ID。有申请吗?
    【解决方案2】:

    This UDF 为 Java 应用程序提供自动化支持。

    示例用法:

    WinActivate("Piface Application Selector")
    _JavaAttachAndWait("Piface Application Selector")
    $java_obj1 = _JavaObjValueGet("", "Type of analysis", "label")
    $java_obj2 = _JavaObjValueGet("", "Run dialog", "push button")
    MsgBox(262144, "_JavaObjValueGet.au3",  "Object values in the Piface Application Selector window include:" & @CRLF & @CRLF & _
    

    【讨论】:

    • OK _JavaObjValueGet 是函数,但如何指定该字段?
    • 使用 autoit 安装文件夹下的 Autoit Window Info 工具。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 2012-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-06
    相关资源
    最近更新 更多