QTP恢复场景-处理找不到列表项或菜单的情况
2010-03-19 16:18
591 查看
relevantcodes.com的这篇文章《Recovery Scenario Test Run Error: Item in list or menu not found》介绍了QTP中用Recovery Senario处理找不到列表项或菜单的情况:
http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/
在定义的恢复场景中使用了Recovery_ListItemIsNotFound这个函数来对错误作出处理:
Function Recovery_ListItemIsNotFound(Object, Method, Arguments, retVal)
Dim sAllItems, arrAllItems, intItem
With Object
'Retrieve all items from the Listbox
sAllItems = .GetROProperty("all items")
'Split 'all items' using a delimiter ";" into an array
arrAllItems = Split(sAllItems, ";")
'Select a random number
intItem = RandomNumber.Value(LBound(arrAllItems), UBound(arrAllItems))
.Select "#" & intItem
Reporter.ReportEvent micInfo, "ListItemIsNotFound", "Item: " & .GetROProperty("value")
End With
End Function
函数的各项参数的意义如下:
Object as Object: The object of the current step.
Method as String: The method of the current step.
Arguments as Array: The actual method's arguments.
Result as Integer: The actual method's result.
http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/
在定义的恢复场景中使用了Recovery_ListItemIsNotFound这个函数来对错误作出处理:
Function Recovery_ListItemIsNotFound(Object, Method, Arguments, retVal)
Dim sAllItems, arrAllItems, intItem
With Object
'Retrieve all items from the Listbox
sAllItems = .GetROProperty("all items")
'Split 'all items' using a delimiter ";" into an array
arrAllItems = Split(sAllItems, ";")
'Select a random number
intItem = RandomNumber.Value(LBound(arrAllItems), UBound(arrAllItems))
.Select "#" & intItem
Reporter.ReportEvent micInfo, "ListItemIsNotFound", "Item: " & .GetROProperty("value")
End With
End Function
函数的各项参数的意义如下:
Object as Object: The object of the current step.
Method as String: The method of the current step.
Arguments as Array: The actual method's arguments.
Result as Integer: The actual method's result.
相关文章推荐
- QTP场景恢复的实践和总结
- maven依赖本地非repository中的jar包-依赖jar包放在WEB-INF/lib等目录下的情况客户端编译出错的处理 maven找不到符号
- QTP - 11-12 (Debugging in QTP ) 调试 & (Recovery Scenarios) 场景恢复
- 无备份恢复各种场景的处理
- QTP场景之恢复增强
- VS2008切换设计视图假死机情况,以及安装Office2007时提示找不到文件的处理
- servlet , or httpservlet找不到包的情况处理
- [原创]QTP场景恢复运用讲解
- QTP 场景恢复– 函数调用
- QTP场景恢复机制步骤
- QTP关闭所有的应用程序窗口,场景恢复
- QTP的错误恢复场景机制
- QTP场景恢复-Function Call
- maven找不到包的情况下本地有包的处理方式
- QTP场景恢复之用例失败自动截图
- QTP几种特殊情况处理
- QTP中的场景恢复
- QTP的那些事--ajax处理的总结篇(不同情况的处理)
- QTP中为什么恢复场景(Recovery Scenario)没有被触发?
- QTP场景恢复