质量中心通过OTA修改自动运行器的状态

发布于 2024-12-27 14:54:06 字数 610 浏览 1 评论 0原文


Quality Center 中的一个简单需求。

背景:
在惠普质量中心 ->测试实验室,您可以创建包含许多测试用例的测试集。您可以通过单击“运行”(这会启动“测试运行计划程序”)来运行测试集或单个测试用例。考虑到测试用例存在测试脚本(考虑 Python),当单击“运行”时,会看到一个“自动运行程序”弹出窗口,其中包含三列:
测试名称、在主机上运行、状态

我知道 OTA API 对于编写测试脚本非常有用。

我的问题是如何通过测试脚本(和 OTA API)修改自动运行器上看到的最终状态。


我有这个要求,因为当调用我的以下测试脚本时,我希望显示一条消息 - '测试用例完成'而不是'错误:无法发布运行'。显示第二条消息是因为我的测试脚本故意取消了运行。这是脚本:

def Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun):
    TDOutput.Print('Do something before cancel')
    CurrentRun.CancelRun()
    TDOutput.Print('Do something after cancel')

A simple need in Quality Center.

Background:
In HP Quality Center -> Test Lab, you can create a testset having many testcases. You can run the testset or individual testcase by clicking on the Run (which starts Test Run Scheduler). Considering that a test script (considering Python) exists for the testcase, when Run is clicked a Automatic Runner popup is seen where you have three columns:
TestName, Run on Host, Status

I am aware of the OTA API which can be really useful to write a testscript.

My question is how can I modify the Final Status seen on the Automatic Runner via the testscript (and OTA API).

I have this requirement because when my following testscript is called, I wish to display a message - 'Testcase Finished' instead of 'Error: Failed to Post Run'. The 2nd message is displayed because my testscript purposely cancels the Run. Here is the script:

def Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun):
    TDOutput.Print('Do something before cancel')
    CurrentRun.CancelRun()
    TDOutput.Print('Do something after cancel')

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

因为看清所以看轻 2025-01-03 14:54:06

这个问题的答案是……这是不可能的!!原因是,QC 有自己的方法来知道测试脚本是否成功通过,它会使状态为“通过”。就像...的情况一样,

def Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun):
    """
    """

    TDOutput.Print("Bye")

状态为“通过”。

如果脚本中捕获到任何 Traceback,它将显示错误消息并将状态更改为“失败”或“未完成”。我猜 QC 并没有让这个可以调整。

我们唯一能做的就是存储提示上显示的输出并将其附加到运行中。

The answer to this question is that.... it cannot be done!! The reason being, QC has its own way of knowing if the testscript passed successfully, it will make the status Passed. Like in the case of...

def Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun):
    """
    """

    TDOutput.Print("Bye")

The status is Passed.

If any Traceback was caught in the script, it will show the error message and change the status to Failed or Not Complete. I guess QC did not make this tweak-able.

Only thing what we can do is store the output shown on the prompt and attach it to the Run.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文