自動化を実行すると、ファイルをローカルに保存できるようになり、QTP スクリプトを使用して QC プロジェクトの特定の場所にアップロードする必要があります (後で再度取得するため)。
これを行う方法についてのアイデアはありますか?
自動化を実行すると、ファイルをローカルに保存できるようになり、QTP スクリプトを使用して QC プロジェクトの特定の場所にアップロードする必要があります (後で再度取得するため)。
これを行う方法についてのアイデアはありますか?
グーグルはあなたの友達です。たとえば、http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/How-to-upload-a-any-type-of-file-to-qualityの次のスクリプト-center-using-QTP/td-p/5297523#.UfpIs5JM_eQは答えのように見え、「upload file qc qtp」というグーグルの最初のヒットの 1 つです。
Dim localFolderPath
localFolderPath = "Local folder path of library files"
call UploadFilesToQC("Subject\BPT RESOURCES\QC Folder Name", localFolderPath )
Public Function UploadFilesToQC(strQCPath,strFilesystemPath)
Dim fileCount, timeNow, timeOld, timeDiff
fileCount = 0
'Get QC connection object
Set QCConnection = QCUtil.QCConnection
'Get Test Plan tree structure
Set treeManager = QCConnection.TreeManager
Set node = treeManager.NodeByPath(strQCPath)
Set AFolder = node.FindChildNode("Library Files") ' Library Files folder Name in QC
set oAttachment = AFolder.attachments
timeOld = Now
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFolder = fso.GetFolder(strFilesystemPath)
Set oFiles = oFolder.Files
'Iterate through each file present in File System path
If oFiles.count >0 Then
For Each oFile in oFiles
Set attach = oAttachment.AddItem(Null)
attach.FileName = oFile.Path
attach.Type = 1
attach.Post()
fileCount = fileCount +1
Set attach = nothing
Next
timeNow = Now
timeDiff = timeNow - timeOld
'Time required to upload all files to QC
Reporter.ReportEvent micDone,"Time required to upload : ", "'" & timeDiff & "' minutes."
'Total Files count uploaded to QC
Reporter.ReportEvent micDone,"Total files uploaded : ", "'" & fileCount & "' files uploaded."
else
Reporter.ReportEvent micFail,"File not found", "No file found at path: " & strFilesystemPath
End If
End Function