51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2933|回复: 3
打印 上一主题 下一主题

[原创] (转)很好!QTP中为什么恢复场景(Recovery Scenario)没有被触发?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-1-27 16:06:11 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
QTP大师TARUN最新作,陈能技大师最近翻译 好东西,第一时间传上来
Tarun Lalwani在这篇文章归纳总结了5种QTP的恢复场景不会被触发的情况:
Why is my Recovery Scenario not getting fired?
http://knowledgeinbox.com/articl ... -not-getting-fired/


Debugging Recovery Scenario (RS) is always been a tough ask. But knowing situations where RS won’t work before hand can be of added

advantage. In this article we will explore various possible scenarios where RS is not fired. We will assume the RS to be fired is “Any Error”

Situation #1 - Script Errors   脚本中没有涉及到测试对象的情况下,RS是不会被触发的!

Errors NOT involving any Test Object won’t fire any recovery scenario. All the code lines listed below will raise an error but not a RS

X = 2/0
Y = Left("Test", -2)

Situation #2 - Object Not in Object Repository (OR)   对象不在OR中这种错误也不会触发RS的执行!

If you try to access a object from the OR and it does not exist in the OR at all, then QTP will throw an error and RS won’t be fired. Object not

found in object repository error is treated as a Script error by QTP and is raised directly.

Situation #3 - Modal dialog blocking execution   模式的对话框挡住了执行也不会触发RS的执行!

In case the operation you have performed causes a modal Dialog to appear, RS can’t get fired in such situations. The simplest example of this

the code shown below

Msgbox "You can't fire a Recovery scenario now"

The call to the Msgbox blocks execution in current thread and QTP get busy waiting for someone to close the message box. In such situations

no RS can get executed

Situation #4 - Associated Library is not found   找不到关联的函数库这种错误也不会触发RS的执行!

In case the RS action is to call a Function from a Library file and Library file is not found, the RS will not get triggered.


Situation #5 - Activate Recovery Scenario setting is not configured properly   如果Active Recovery Scenario被设置为“Never”也不会触发RS

Go to File->Settings…->Recovery (Tab)->Activate Recovery Scenario option. If the value is set to ‘Never’ no RS can get fired, in case value is

set to ‘On Error’ then the recovery scenario will only be fired when an error occurs. In case the scenario is not fired change this setting to ‘On

Every Step’
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2010-1-28 12:11:39 | 只看该作者
翻译在右边,呵呵,陈大师翻译的
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2010-1-28 11:10:05 | 只看该作者
对于我来说,场景恢复就是,关闭IE再重新打开到登陆页面,或者F5刷新全部(我测的是WEb程序)
因为错误千变万化,实在不好判断,所以索性就是一个"On Error"不管是啥错误都一样处理..(.检查点不懂过不算错误)
回复 支持 反对

使用道具 举报

该用户从未签到

2#
发表于 2010-1-28 11:01:39 | 只看该作者
在哪呢?翻译?
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-25 10:05 , Processed in 0.071956 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表