|
不知道这个能不能解决你的问题
运行前,先打开Windows自带的计算器
Call calc("1","+","1","2")
Function calc(a,b,c,sexpect)
Window("Calculator").WinButton("C").Click
wait 1
Window("Calculator").WinButton(a).Click
wait 1
Window("Calculator").WinButton(b).Click
wait 1
Window("Calculator").WinButton(c).Click
wait 1
Window("Calculator").WinButton("=").Click
wait 1
'msgbox Window("Calculator").WinEdit("Edit").GetROProperty("text")
sGetValue = Trim(Window("Calculator").WinEdit("Edit").GetROProperty("text"))
If right(sGetValue,1) = "." Then
sexpect = sexpect&"."
End If
If sGetValue = sexpect Then
msgbox "true"
else
msgbox "false"
End If
End Function |
|