OTA: Download QTP Reports issue
I've used the "search" function but could not find anything similar to my issue [img]/images/graemlins/frown.gif[/img]
I'm trying to do the following from a QTP script:
1) get all the runs of instance 1 from a given test set
2) for each run, download the results.xml and default.xls files in a specific directory on the pc which executes the script.
The 1) part runs ok, but I've got issues with 2): my script only downloads the files related to all the runs of the last test in my execution flow.
I always execute all the tests of the same instance in sequence and on the same pc. Therefore, when i click "run test set", all instance 1 tests go on pc1, and all instance 2 tests go to pc2. The attached image (testsetWF) helps to understand my execution flow.
I want to run my script from another pc, say pc3.
The result is that the script correctly identifies all the Runs in the test set but then only downloads files for the "Emissione Proposta" test, which is the last one of the ex.flow.
I tried with both the TestFactory.RepositoryStorage and Run.ExtendedStorage objects but the issue was always the same.
Here is my script:
<font class="small">Code:</font><hr /><pre>
testSetName = "'UPD20080801E - colldir - batteria'"
destBasePath = "C:\Documents and Settings\" & Environment("UserName") & "\Desktop\downloads"
'search the testSet by name
tsId = getTestSetId(testSetName)
'get all runs in the testSet that have an instance code = 1 and order them by exec date desc.
Set runList = getFlowRuns(tsId, 1)
print "I found " & runList.count & " runs."
Set fso = CreateObject("Scripting.FileSystemObject")
For each theRun in runList
Set repSt = QCUtil.QCConnection.TestFactory.RepositoryStorage
'ref to the test linked to this run
Set theTest = QCUtil.QCConnection.TestFactory.Item(theRun.TestId )
'download directory depends on the test set, run name and test name and instance
destPath = destBasePath & _
"\" & testSetName & _
"\" & theRun.Name & _
"\[" & theRun.TestInstance & "] " & theTest.Name & "\"
repSt.ClientPath = destPath
repSt.ServerPath = theRun.ResultLocation
print theRun.Name & " - [" & theRun.TestInstance & "] " & theTest.Name
print vbTab & "Res. location: " & theRun.ResultLocation
d = repSt.load("-r Default.xls, -r Results.xml", true)
If fso.folderexists(d) Then
print vbTab & "Files downloaded into: " & vbNewLine & vbTab & d
Set repSt = nothing
Set theTest = nothing
Set theRun = nothing
Set fso = nothing
Has anybody ever had similar problems?
Any help would be much appreciated!
P.s. I use QTP 9.2 and Quality Center 9.2 (no patch)