我可以确定当前的测试执行人员是来自测试实验室还是来自 QTP IDE 中的交互式测试?
检查当前 QTP 测试执行是否是交互式的(即不是从 QC 测试实验室启动的 QC 测试集执行的一部分)的最有效方法是什么?
你们知道一个很酷的方法吗? WR 曾经有一个批处理运行标志,对于 IDE 内的所有执行,该标志都会被可靠地清除。也许QTP有类似的东西,而我忽略了?
首先,我考虑查看 OnError
属性:
Set qtApp = getObject("","QuickTest.Application")
qtApp.Test.Settings.Run.OnError
现在返回以下可能值之一: “对话框”、“NextIteration”、“停止”或“NextStep”。
这将允许我查看 OnError
设置,它可能是 <> “对话框”和<>当执行是测试集的一部分时“停止”,但是:
- 我设法在所有 QTP 测试中避免自动化接口,这将是我的第一个例外(早期的 QTP 版本感到困惑并启动了第二个 QTP 实例,产生了很多问题...)
- 测试人员可能会在 QTP IDE 中执行“交互式”运行,并将此设置设置为“NextStep”或“NextIteration”,然后我会在代码中误解它。
- 即使没有出现对话框(由于从 QC 测试集执行),它也不起作用,返回的值是“Dialog”。卫生部!
What is the most efficient way to check if the current QTP test execution is interactive, i.e. not part of a QC test set execution launched from the QC test lab?
Do you guys know a cool way? WR used to have a batch run flag which reliably was cleared for all executions from within the IDE. Maybe QTP has something like this, and I overlooked it?
First, I thought about looking at the OnError
property:
Set qtApp = getObject("","QuickTest.Application")
qtApp.Test.Settings.Run.OnError
now returns one of these possible values:
"Dialog", "NextIteration", "Stop" or "NextStep".
This would allow me to look at the OnError
setting, which probably is <> "Dialog" and <> "Stop" when execution is part of a test set, but:
- I managed to avoid the automation interface in all my QTP tests, this would be my first exception (earlier QTP versions got confused and launched a second QTP instance, creating lots of problems...)
- A tester might do an "interactive" run from within the QTP IDE with this setting set to "NextStep" or "NextIteration", which I then would misinterpret in my code.
- It does not work, even if dialogs are not coming up (due to execution from a QC test set), the value returned is "Dialog". DOH!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无需转到自动化对象,它在
Setting
对象中公开。请注意,TestDirector (TD) 是 QualityCenter (QC) 的历史名称。
No need to go to the automation object, it is exposed in the
Setting
object.Note that TestDirector (TD) is the historical name of QualityCenter (QC).
选项
它可能是一个基于 QCUtil.CurrentTestSetTest 的 。不幸的是,如果您以交互方式运行 GUI 测试,它会返回
true
,因此它并不是一个真正完整的解决方案。但由于其他选项不适用于 BPT 组件,因此我现在使用此选项。
It might be an option to use
which is based on
QCUtil.CurrentTestSetTest
. Unfortunately, it returnstrue
if you run a GUI test interactively, so it is not really a complete solution.But since the other option does not work with BPT components, I am now using this option.