我可以确定的测试实验室或交互从QTP IDE中电流测试的高管? [英] Can I determine if current test execs from test lab or interactively from within QTP IDE?

查看:202
本文介绍了我可以确定的测试实验室或交互从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:


设置qtApp =的getObject(,QuickTest.Application)

qtApp.Test.Settings.Run.OnError 现在返回这些可能的值之一:
对话,NextIteration,停止或NextStep自动。

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,然后我会misinter preT在我的code。

  • 这是不行的,即使对话框不上来了(因为从QC测试集执行),返回的值是对话。 DOH!

推荐答案

没有必要去自动化对象,它在设置对象暴露出来。

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天全站免登陆