I have to write a VBscript that will run a particular testscript from testset (Test Lab) in QC. Also, I have to dynamically import a datasheet for the test in QC.
I implemented the first one.
It is running the whole testset instead of the ID i specified.
I have no idea how to import DataTable for a test that is run from QC TestLab.
Public Function Func_DownloadAttachement_FromQC(pvt_QC_Folders_NodeName, pvt_LocalFolderPathWhereFileshaveTobeDownloaded)
Set tdc=TDUtil.TDConnection
Set gTreeManager = tdc.TreeManager
Set root=gTreeManager.TreeRoot("Subject")
set gSysTreeNode = gTreeManager.NodeByPath(pvt_QC_Folders_NodeName)
Set fact=gSysTreeNode.Attachments
Set alist = fact.NewList("")
'Find the right attachment and download it to the temp folder
For Each att In alist
Set ext = att.AttachmentStorage
attname = att.DirectLink 'other functionality att.id, att.filename
Out_file_Name = Replace(attname, gSysTreeNode.NodeID,"")
ext.Load attname, True
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.GetFile(ext.ClientPath & "\" & attname)
MyFile.Copy ( pvt_LocalFolderPathWhereFileshaveTobeDownloaded & "\" & Out_file_Name)
Set fso = Nothing
Set MyFile = Nothing
I tried to get the attachment associated with my testscript.
There is no attachment with the script.
I used the below code:
Code:
Set PlanTestFactory = QCConn.TestFactory
Set PlanTestFilter = PlanTestFactory.Filter
PlanTestFilter.Filter("TS_NAME") = "Google_Search"
PlanTestFilter.Filter("TS_SUBJECT") = Chr(34) & "Subject\Release11\QTP-Dummy" & Chr(34)
Set PlanTest = PlanTestFactory.NewList(PlanTestFilter.Text)
Set TSTObjToRun = PlanTest(1)
Set AttachmentObj = TSTObjToRun.Attachments
'----------------------------------------------------> It does not enter for loop
For Each attname In AttList
attActName = attname.DirectLink
MsgBox attActName
Next
Additional Information:
I saved the Test script in QC using SaveAs option in QTP.
In QC, i did not find any attachments for for the test script.
How do i import a new file during run time.
Also can you pls help me to execute only one script in a test set.
I have written code, but it is executiong the whole testset despite providing the id of the test instance.
Ex., Scheduler.Run ID
01-03-2012, 04:43 PM (This post was last modified: 01-04-2012, 09:41 AM by sshukla12.)
Hi,
Please find the attachment for executing a particular test from QC.
test u want to execute , pass it under
qtp_test(0)= "VPP - Primary IP ADSL without BackUp Creation"
and for the next part of ur query to import the datasheet, u can create a function and call it in your test scripts that will load the datasheet from QC with respect to ur test case.