|
1.检查点(Checkpoint)
检查点的检查是对某个或某此对象的属性进行检查,检查是否与预期值保持一致。这是最基础的一种检查方法。在这种方法中,测试中的预期值是我们预先就知道的。
QTP脚本:
Dim actual_value
' Get the actual property value
actual_value = obj.GetROProperty(prop_name)
' Compare the actual value to the expected value
If actual_value = expected_value Then
Reporter.ReportEvent micPass, "VerifyProperty Succeeded", "The " & prop_name & " expected value: " & expected_value & " matches the actual value"
VerifyProperty = True
Else
Reporter.ReportEvent micFail, "VerifyProperty Failed", "The " & prop_name & " expected value: " & expected_value & " does not match the actual value: " & actual_value
VerifyProperty = False
End If
我再论坛里面看到的!希望对你有用! |
|