client.Connect "127.0.0.1",8888
client.SetProjectBaseDirectory "C:\\Users\\TEMP\\workspace\\tuangou"
client.SetApplicationTitle "adb:M9W1B08AKDUHXO2991"
Report
client.Click "default","element 0",1
Report
client.Sleep 15000
Report
client.Click "default","element 8",1,0
Report
client.Sleep 3000
Report
client.Click "default","element 2",167,"element 3",1
Report
client.Sleep 3000
Report
client.Click "default","element 4",157,"element 7",141,0
Report
client.Sleep 3000
Report
client.SendText "{ESC}"
Report
client.Click "default","element 1",1
Report
Sub Report()
Dim logLine,outFile,status,errorMessage
logLine = client.GetResultValue ("logLine")
outFile = client.GetResultValue("outFile")
status = client.GetResultValue("status")
If StrComp (status,"True") = 0 then
Reporter.ReportEvent micPass,logLine,"",outFile
else
errorMessage = client.GetResultValue("errorMessage")
Reporter.ReportEvent micFail,errorMessage,outFile
end if
End Sub
在See Test中录制好过程,然后转化为QTP VB Script,直接在QTP中就可以运行了。
原文链接:https://www.f2er.com/vb/259790.html