Micro Focus QTP (UFT) Forums

Full Version: Test Set Run automatically
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,

Need your help to run my all tests which are present in a particular test set in HPQC (12.0) using VB script. I am using below code. I am not getting any error but the tests in QC are not changing their status from "No Run".


set tdc = createobject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "https://almbt12.saas.hp.com/qcbin"
tdc.login "My_UserName","My_Password"
tdc.Connect "Domain","Project"

Set objShell = CreateObject("WScript.Shell")
Set TSetFact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tsFolder = tsTreeMgr.NodeByPath("Root\")
Set tsList = tsFolder.FindTestSets("")

Set theTestSet = tsList.Item(2)
Set Scheduler = theTestSet.StartExecution("")
Scheduler.RunAllLocally = True
Scheduler.run
Set execStatus = Scheduler.ExecutionStatus

msgbox "1"
Do While RunFinished = False
 execStatus.RefreshExecStatusInfo "all", True
 RunFinished = execStatus.Finished
 Set EventsList = execStatus.EventsList
 For Each ExecEventInfoObj in EventsList
  strNowEvent = ExecEventInfoObj.EventType
 Next
 For i= 1 to execstatus.count
  Set TestExecStatusobj =execstatus.Item(i)
  intTestid = TestExecStatusobj.TestInstance
 Next
 Loop

tdc.Disconnect
tdc.Logout
tdc.ReleaseConnection


Thanks in Advance
Santhosh