Thursday, November 4, 2010

Schedule/execute testset run in Quality Center from Windows (VBScript)

http://the-koala-egg.blogspot.com/2008/02/scheduleexecute-testset-run-in-quality.html
-----------------
VBScript:

Dim QCConnectionSet
QCConnection = CreateObject("TDApiOle80.TDConnection")



QCConnection.InitConnectionEx "server_address" ' <--------------- Fill in server addressQCConnection.login "user", "pwd" '<------------------- FILL in user/pwd

QCConnection.Connect "domain_name", "project_name" '<----------- FILL Domain/Project

Set TSetFact = QCConnection.TestSetFactory
Set tsTreeMgr = QCConnection.TestSetTreeManager
nPath = "Root\test" '<------------- FILL IN PATH TO TESTSET

Set tsFolder = tsTreeMgr.NodeByPath(nPath)
If tsFolder Is Nothing Then
msgbox "error"

End If


Set tsList = tsFolder.FindTestSets("name_of testset") '<------- FILL IN NAME OF TESTSET
If tsList.Count > 1 Then
MsgBox "FindTestSets found more than one test set: refine search"
ElseIf tsList.Count <>
MsgBox "FindTestSets: test set not found"
End If


Set theTestSet = tsList.Item(1)
Set Scheduler = theTestSet.StartExecution("")
Scheduler.RunAllLocally = True
Scheduler.HostTimeOut = 100000
Scheduler.runSet execStatus = Scheduler.ExecutionStatus

RunFinished = False
while RunFinished = False
execStatus.RefreshExecStatusInfo "all", True
RunFinished = execStatus.Finished

wend

QCConnection.Disconnect
QCConnection.Logout
Set QCConnection = Nothing

---------------

No comments:

Post a Comment