从autoit中的文本字段中获取值

时间:2014-11-02 15:55:10

标签: swing testing autoit

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

2 个答案:

答案 0 :(得分:0)

从帮助文件中:

; *******************************************************
; 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

答案 1 :(得分:0)

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 & _