Question


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')
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top