您的位置:首页 > 编程语言 > Qt开发

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.
 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息