Friday, 9 August 2013

Code to Upload All the Local Files(e.g. Library) to the QC Test Plan Using OTA

Code is as follows – 
strFilePathToSave = “C:\Library\function.vbs”
Set QCConnection = QCUtil.QCConnection
Set treeManager = QCConnection.TreeManager

‘ Specify the local path to the file.
LocalFilePath = strFilePathToSave
‘ Specify the Quality Center path to the desired folder
QC_Path =”Subject\BW Automation\Library”
Set node = treeManager.nodebypath(QC_Path)
set att = node.attachments
Set atta = att.AddItem(Null)
atta.FileName = LocalFilePath
atta.Type = 1
atta.Post()

Note – This code uploads only one file, run this code in loop & assign file names to variable strFilePathToSave, will upload all files from local folder.

No comments:

Post a Comment