|
下面这个程序是我自己写的TextCheckpoint的VBS脚本,供大家指点:
***********************************************************************************************************
Dim a,b
a = Window("Flight Reservation").Dialog("Flight Reservations").Static("The information has changed. Save changes?").GetROProperty("text")
b = "The information has changed. Save changes?"
Check_Objects_Text a, b
Window("Flight Reservation").Dialog("Flight Reservations").WinButton("No").Click
Function Check_Objects_Text(realText,strText)
Dim Mycomp
strText = "The information has changed. Save changes?"
Mycomp = StrComp(realText, strText, 1)
msgbox strText
msgbox realText
If Mycomp = 0 Then
Reporter.ReportEvent micPass,"检查字符串是否一致","界面中包含字符串:"&strText
else
Reporter.ReportEvent micFail,"检查字符串是否一致","界面中不包含字符串:"&strText
End If
End Function
*********************************************************************************
另外,本人最近在考虑测窗口标题的VBS,目前只用了exist,但是也想写点类似以上的代码,还希望大家多给宝贵意见。。。 |
|