' Calculator An addition calculation, and will the actual value, the test result output, eventually imported to the local
Dim I
Dim input
Dim Expertvalue,actualvalue
DataTable. Importsheet"C:\Users\Administrator\Desktop\UFT activity lecture material \ Addition Operation Case.xlsx","Sheet1","Action1"
' Wait 3
Systemutil. Run"C:\Windows\System32\calc.exe"
For I=1To the DataTable. Getsheet("Action1"). GetRowCount
Input=datatable. Value("Input","Action1")
Window(Calculator). Winbutton(C). Click
Window(Calculator). Winbutton(Input). Click
Window(Calculator). Winbutton("+"). Click
Window(Calculator). Winbutton("2"). Click
Window(Calculator). Winbutton("="). Click
Expertvalue=datatable. Value("Expertvalue","Action1")
Actualvalue= Window(Calculator). Static("9"). Getroproperty("Text")
If Expertvalue=actualvalueThen
Reporter. ReportEvent Micpass,"One number added result",Success
DataTable. Value("Actualvalue","Action1") =actualvalue
DataTable. Value("Status","Action1")="Pass"
Else
Reporter. ReportEvent Micfail,"One number added result",Failed
DataTable. Value("Actualvalue","Action1") =actualvalue
DataTable. Value ( "Action1" Span style= "color: #000000;" >) =
end if
datatable. Getsheet (). Setnextrow
next
Window ( "calculator"
DataTable. Exportsheet "Action1"
Calculator An addition calculation, and the actual value, the test results output, and finally imported to the local