Get Test Instance details/test execution details of specific test sets from QC through a VBScript
I use the following Query in Excel Report to get test instance details within QC
SELECT CF_FATHER_ID AS FOLDER_Father,
CF_ITEM_NAME AS TEST_SET_FOLDER, CY_CYCLE AS TEST_SET, TESTCYCL.TC_TEST_ID AS TEST_ID, TS_NAME AS TEST_SCRIPT, TC_STATUS AS TEST_SET_EXECUTION_STATUS , TC_ACTUAL_TESTER as TESTER, TESTCYCL.TC_PLAN_SCHEDULING_DATE as PLANNED_EXECUTION_DATE , TC_EXEC_DATE as ACTUAL_EXECUTION_DATE , TESTCYCL.TC_EXEC_TIME AS TEST_EXECUTION_TIME
TS_TEST_ID = TC_TEST_ID
TC_CYCLE_ID = CY_CYCLE_ID
CY_FOLDER_ID = CF_ITEM_ID
CF_FATHER_ID IN ( '1170','1171','1172','1173')
CF_ITEM_NAME , TESTCYCL.TC_TEST_ID
But i need to get the same information without using excel report and instead use VBScript. I am able to connect to QC through VBScript but i do not know the Syntax to get test instance related information. I am pasting below the script i could come up with, please help me fill in the Gaps in script and correct it as needed. this is very urgent so please help.
Dim UserN, QCUserN, UserP, QCDomain, QCProj, QCAddr,Row,a,b
QCUserN = "User Name"
UserP = "Password"
QCDomain = "Domain name"
QCProj = "project name"
QCAddr = "URL/qcbin"
Row = "1"
a = Replace(date,"/","")
b = replace(Time,":","")
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
QCConnection.login QCUserN, UserP
QCConnection.Connect QCDomain, QCProj
If (QCConnection.Connected <> True) Then
WScript.Echo "QC Project Failed to Connect"
On Error Resume Next
WScript.Echo "Extract from QC here and format it out"
Set TestSetFact = QCConnection.TestSetFactory
Set TestSetFilter = TestSetFact.Filter
TestSetFilter("CF_FATHER_ID") = "1170" or "1171" or "1172" or "1173"
Set TestSetList = TestSetFilter.NewList
'I Need to know if the Filter set in above lines is correct.
'I NEED Help to Continue with the script from here and get the Details of Test Instance so that i can populate the columns in excel as listed below.
Set Excel = CreateObject("Excel.Application") ' Open Excel
Excel.WorkBooks.Add() ' Add a new workbook
Set Sheet = Excel.ActiveSheet
For Each TestCase In TestList
'Save a specified set of fields.
Sheet.cells(Row, 1).Value = TestCase.Field("CY_CYCLE")
Sheet.Cells(Row, 2).Value = TestCase.Field("TC_TEST_ID")
Sheet.Cells(Row, 3).Value = TestCase.Field("TS_NAME")
Sheet.Cells(Row, 4).Value = TestCase.Field("TC_STATUS")
' and continue so on to fill all the fields
Row = Row+1
'Save the newly created workbook and close Excel.
Excel.ActiveWorkbook.SaveAs("C:\Documents and Settings\Admin\Desktop\QualityCenter_Demo"&a&b&".xls")
If Err.number <> 0 Then WScript.Echo Err.Description & ":" & Err.Number
WScript.Echo "Report Complete"
Re: Get Test Instance details/test execution details of specific test sets from QC through a VBScrip
For your question, you will get help in the ALM OTA Referrence.
Check the example code section > Test execution code samples