QTP CheckPoint设置
来源:互联网 发布:sfp plus端口 编辑:程序博客网 时间:2024/06/09 17:18
检查点、验证点方法------CheckProperty方法
object.CheckProperty(PropertyName, PropertyValue, [TimeOut])
-------------------------------------------------------------------------------------------------
PropertyName:要检查的属性名
PropertyValue:预期结果值(如果最后检查完毕,发现不符合预期值,则会返回False,并引入QTP测试报告;反之,则返回True,并在测试报告中以Passed显示)
TimeOut:等待时间,单位毫秒
检查点例子:
Set oBrowser=Description.Create()
oBrowser("micClass").value="Browser"
Set oPage=Description.Create()
oPage("micClass").value="Page"
Set oWebEdit=Description.Create()
oWebEdit("name").value="wd"
Browser(oBrowser).Page(oPage).WebEdit(oWebEdit).Set "12306"
Browser(oBrowser).Page(oPage).WebEdit(oWebEdit).CheckProperty "value","12306"
Set oBrowser=Nothing
Set oPage=Nothing
Set oWebEdit=Nothing
自定义检查点------ReportEvent
Reporter函数有3个属性(Filter,ReportPath,RunStatus)和2个方法(ReportEvent,ReportNote),自定义检查点是针对Reporter函数的ReportEvent方法来说的
Description
Reports an event to the run results.
Syntax
Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
EventStatus,测试结果的状态,有4种状态
- micPass: 对应数字0
- micFail: 对应数字1
- micDone: 对应数字2
- micWarning: 对应数字3
ReportStepName,在测试报告中显示的测试名字
Details,在测试报告中显示的测试描述
ImageFilePath,不是必填项,将截图插入到报告中
自定义检查点例子:
Set oBrowser=Description.Create()
oBrowser("micClass").value="Browser"
Set oPage=Description.Create()
oPage("micClass").value="Page"
Set oWebEdit=Description.Create()
oWebEdit("name").value="wd"
Dim ActualValue
Dim ExpectedValue
ExpectedValue="12306"
Browser(oBrowser).Page(oPage).WebEdit(oWebEdit).Set ExpectedValue
ActualValue=Browser(oBrowser).Page(oPage).WebEdit(oWebEdit).GetROProperty("value")
'If ActualValue=ExpectedValue Then
'Reporter.ReportEvent micPass,"文本框输入测试","百度首页文本框输入测试"
'Reporter.ReportNote "This test was run from Lemon_s."
'else
'Reporter.ReportEvent micFail,"文本框输入测试","百度首页文本框输入测试"
'End If
If ActualValue=ExpectedValue Then
i=0
else
i=1
End If
Reporter.ReportEvent i,"文本框输入测试","百度首页文本框输入测试"
Reporter.ReportNote "This test was run from Lemon_s."
Set oBrowser=Nothing
Set oPage=Nothing
Set oWebEdit=Nothing
自定义检查点和CheckProperty区别:
- CheckProperty使用到的ReportEvent只有2种,Pass和Fail,而自定义检查点有4种
- CheckProperty只能检查控件的属性,自定义检查点可以检查各种各样的代码逻辑,从多角度去验证自动化测试
- CheckProperty的StepName和Details由系统自动生成,自定义检查点可以自由键入
- CheckProperty没有讲截图插入在测试报告中的功能,自定义检查点有
自定义检查点状态和测试结果的关系
- 在一个测试中,只要有一个Fail,整个测试的结果就是Fail
- 如果没有Fail,只要有一个Warning,这个测试的结果就是Warning
- 全部是Pass,整个测试结果才Pass
- Done不影响这个测试的结果
- QTP CheckPoint设置
- QTP检查点CheckPoint解析
- QTP设置检查点,通过判断检查点checkpoint的值进行相应操作
- qtp设置
- 浅谈QTP的数据库检查点Database checkpoint使用流程
- checkpoint
- CheckPoint
- checkpoint
- CheckPoint
- checkpoint
- Checkpoint
- checkpoint
- Checkpoint
- checkpoint
- QTP设置实际值
- 设置QTP replaytype
- QTP 同步点设置
- QTP代码字体设置
- 各种Ajax框架的对比介绍:
- BREW开发教程(1):BREW SDK一览
- BREW开发教程(2):BREW基础
- linux 串口应用开发
- BREW开发教程(3):BREW编程概念
- QTP CheckPoint设置
- BREW开发教程(4):BREW消息处理机制
- BREW开发教程(5):嵌入式文件系统中访问文件及其API
- BREW开发教程(6):BREW “Hello,World!”应用示例
- Mobicents SIP Servlets的Click2Call实例实践
- EllysXors(SRM543-div1-1-div2-2)
- BREW开发教程(7):BREW应用开发基础
- EllysThreeRivers(SRM543-div2-3)
- 浏览其中的【navigator】对象的【userAgent】判断浏览器。