0

We are using ALM 12. We have multiple folders in our Test Resources module, and some of the resources stored in these folders have the same name as in other folders. I am able to download a resource using the name, but can't figure out how to get a resource under a specific folder. Anyone know how to download a resource specifying the folder to download it from?

e.g Folder1 mysheet.xls Folder2 mysheet.xls

I want to download Folder2\mysheet.xls and not Folder1\mysheet.xls

Kyle
  • 1
  • 1
  • 3

2 Answers2

0

You could download the resource by resource id rather than resource name.

Below is VBS sample (with OTA API) for your reference:

Option Explicit

Dim tdc, cust, resource

set tdc = CreateObject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "http://YourALMServer:Port/qcbin"
tdc.Login "username", "password"
tdc.Connect "domainName", "projectName"

# 1001 is the resource id which you want to download.
set resource = tdc.QCResourceFactory.Item("1001")
# "C:\\tmp\\" is the local path where you want to place the downloaded resource
resource.DownloadResource "C:\\tmp\\", TRUE

tdc.Disconnect
tdc.Logout
tdc.ReleaseConnection
Allen
  • 21
  • 3
0
Option Explicit

Dim objCon, cust, resource
set objCon= CreateObject("TDApiOle80.TDConnection")
objCon.InitConnectionEx "http://YourALMServer:Port/qcbin"
objCon.Login "username", "password"
objCon.Connect "domainName", "projectName"

Set oResourceFolder = objCon.QCResourceFolderFactory
Set oFilter = oResourceFolder.Filter
oFilter.Filter("RFO_NAME") ="abc" \\ abc is your folder name 
Set oList = oFilter.NewList()
set oChild = oList.item(1).QCResourceFactory.NewList("") 
''assuming that there is only 1 folder with name "abc" in Test Resources section
For i =1 to oChild.count Step 1
 oChild.item(i).DownloadResource "c:\\a", TRUE
''c:\\a is the location where we need to safe the resource
next
set objCon = Nothing