1、检查点、验证点方法——checkproperty
object.checkproperty(property name,property value,【timeout】) object:对象的意思
property name:要检查的属性名
property value:预期的结果值(如果最后检查完毕后,发现不符合预期值,则会返回false,并引入qtp测试报告,反之则反回true,并在测试报告中以passed显示)
time out:等待时间,单位:毫秒
例子:browser(“百度”).page(“百度”).webedit(“wd”).set “haha”
browser(“百度”).page(“百度”).webedit(“wd”).checkproperty“value”,“haha”
2、自定义检查点——reportevent
reporter.reportevent eventstatus,reportstepname,details【,imagefilepath】
eventstatus。测试结果的状态,有四种状态
(1)micpass:对应数字0
(2)micfail:对应数字1
(3)micdone:对应数字2
(4)micwarning:对应数字3
reportstepname,在测试结果中显示的测试名字
details,在测试结果中显示的测试描述
imagefilepath,不是必填项,将截图插入到报告中
例子:for i=1 to 4
if i=1 then
reporter.reportevent micpass,“step 1”,“micpass =0 ”
else if i=2 then
reporter.reportevent micfail,“step 2”,“micfail=1”
else if i=3 then
reporter.reportevent micdone,“step 3”,“micdone=2”
else if i=4 then
reporter.reportevent 3,"step 4","3=micwarinig"
else
end if
next
3、自定义检查点和checkproperty区别
(1)在一个测试中,只要有一个fail,整个测试的结果就是“fail”
(2)如果没有fail,只要有一个 warning,这个测试的结果就是 warning
(3)全部都是 pass,整个测试结果才是 pass
(4)done 不影响这个测试的结果