我可以确定当前测试执行人员是来自测试实验室还是在 QTP IDE 中以交互方式执行? [英] Can I determine if current test execs from test lab or interactively from within QTP IDE?

查看:15
本文介绍了我可以确定当前测试执行人员是来自测试实验室还是在 QTP IDE 中以交互方式执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

检查当前 QTP 测试执行是否是交互式的(即不是从 QC 测试实验室启动的 QC 测试集执行的一部分)的最有效方法是什么?

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?

你们知道一个很酷的方法吗?WR 曾经有一个批处理运行标志,该标志可靠地为 IDE 内的所有执行清除.也许QTP有这样的东西,我忽略了它?

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?

首先,我想到了查看 OnError 属性:

First, I thought about looking at the OnError property:

Set qtApp = getObject("","QuickTest.Application")

qtApp.Test.Settings.Run.OnError 现在返回以下可能值之一:Dialog"、NextIteration"、Stop"或下一步".

qtApp.Test.Settings.Run.OnError now returns one of these possible values: "Dialog", "NextIteration", "Stop" or "NextStep".

这将允许我查看 OnError 设置,它可能是 <>对话"和 <>停止"当执行是测试集的一部分时,但是:

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:

  • 我设法在所有 QTP 测试中避免使用自动化接口,这将是我的第一个例外(早期的 QTP 版本混淆并启动了第二个 QTP 实例,产生了很多问题......)
  • 测试人员可能会执行交互式"测试.从 QTP IDE 中运行,将此设置设置为NextStep";或NextIteration",然后我会在我的代码中误解.
  • 它不起作用,即使没有出现对话(由于从 QC 测试集执行),返回的值为对话".DOH!

推荐答案

不需要去自动化对象,它暴露在Setting对象中.

No need to go to the automation object, it is exposed in the Setting object.

If Setting("IsInTestDirectorTest") Then
    Print "Run from QC"
Else
    Print "Not run from QC"
End If     

请注意,TestDirector (TD) 是 QualityCenter (QC) 的历史名称.

Note that TestDirector (TD) is the historical name of QualityCenter (QC).

这篇关于我可以确定当前测试执行人员是来自测试实验室还是在 QTP IDE 中以交互方式执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆