Release Automation

 View Only
  • 1.  HP QC - Run Test Action

    Broadcom Employee
    Posted Jul 30, 2014 09:32 AM

    I need some clarification on using “HP QC – Run Test” action. In the Action there is “Status” input, when we use this action it is setting the Status on QC whatever we specify in the action, irrespective of actual Test Status.

     

    Isn’t the Status should be the output value? Can someone please explain how this supposed to work.

     

    HP QC.png

     

    And the Description related to this field is no help.

     

    HP QC2.png



  • 2.  Re: HP QC - Run Test Action

    Posted Dec 21, 2014 01:49 PM

    Encountered the same at client side recently. Wonder what's the use of this action pack if it's not triggering anything.

     

    After some discovering journey, it looks like we can trigger via Powershell action pack, but some dependencies on the agent server:

     

    1)DOTNET 4.0 or above
    2)HP ALM Client Registration (http://{Insert QC Server}/qcbin/CommonMode_index.html)
    3)HP Quality Center Connectivity (http://{Insert QC Server}/qcbin/TDConnectivity_index.html)

     

    Will share the code here once it's fully tested.



  • 3.  Re: HP QC - Run Test Action

    Posted Dec 21, 2014 11:15 PM

    Sample trigger using powershell. (remove the comments if exceeded 1024 limit)

     

    $tsFolderName = "Root\***\***\***\"

    $tSetName = "LISA_TestSet"

    $hpqcURL = "http://***/qcbin"

    $username = "***"

    $tsPassword = "***"

    $qcDomain = "***"

    $qcProject = "***"

     

    $connObject = new-object -comobject TDApiOle80.TDConnection -strict

     

    $connObject.InitConnectionEx($hpqcURL)

    $connObject.Login($username, $tsPassword)

       

    #Connect to project

    $connObject.Connect($qcDomain, $qcProject)

       

    $TSetFact = $connObject.TestSetFac

    $tsTreeMgr = $connObject.TestSetTreeManager

    $tsFolder = $tsTreeMgr.NodeByPath($tsFolderName)

     

    $tsList = $tsFolder.FindTestSets($tSetName)

       

    $theTestSet = $tsList.Item(1)

    write-host Test ID:$theTestSet.ID

     

    #Start the scheduler on the local machine.

    $tsScheduler = $theTestSet.StartExecution("")

     

    $tsScheduler.RunAllLocally = 1

    $tsScheduler.LogEnabled = 1

     

    $tsScheduler.Run()

    # Need to sleep, else run will fail

    Start-Sleep -s 1

     

    $status = $tsScheduler.ExecutionStatus

    write-host Log: $tsScheduler.ExecutionLog

    write-host Status: $status.Finished



  • 4.  Re: HP QC - Run Test Action

    Posted Feb 05, 2016 02:43 AM

    A great script........one thing to mention is that you MUST use 32-bit powershell for this......as QC is a 32-bit App.

     

    But how do you get it to execute in a user session?  Our powershell actions run in session zero??



  • 5.  Re: HP QC - Run Test Action

    Posted Feb 09, 2016 04:05 PM

    And don't forget to log out and disconnect at the end!

     

    I've also added a loop to let the test script finish before returning....