Dim number1,number2,Out,ExceptValue
systemutil.Run "C:/VB-Calc.exe"
number1=datatable("canshu1",dtlocalsheet)
number2=datatable("canshu2",dtlocalsheet)
quzhi(number1)
Window("Form1").RunAnalog "Track1"
VbWindow("Form1").VbButton("+").Click
quzhi(number2)
VbWindow("Form1").VbButton("=").Click
VbWindow("Form1").Output CheckPoint("Form1")
Out=datatable("output",dtlocalsheet)
ExceptValue=datatable("ExceptValue",dtlocalsheet)
If ut=ExceptValue Then
msgbox "this testcase is pass"
else
msgbox" this testcase is fail"
End If
Function quzhi(byval str)
str=cstr(str)
Dim i,strnum,Clicknumber
strnum=len(str)
For i=1 to strnum
Clicknumber=mid(str,i,1)
VbWindow("Form1").VbButton(Clicknumber).Click
Next
End Function
VbWindow("Form1").Close
canshu1:为下面的表,里面写你相应的数据
canshu2:为下面的表,里面写你相应的数据
output:为下面的表,是把计算出来的结果放到这个表里面
ExceptValue:为下面的表,里面写你的预期值