Tuesday, 9 September 2014

QTP - Upload file in QC thru QTP

'// This function will upload any file into QC as attachment.

filepath="C:\Auto\Results\results_xyz_02.xls"

Public function z_attachtoQC(filepath)
                 Set nowTest = QCUtil.CurrentTestSet
                 Set attachmentPath = nowTest.Attachments
                 Set nowAttachment = attachmentPath.AddItem(Null)

                 'Replace with the path to your file:

                 nowAttachment.FileName = filepath
                 nowAttachment.Type = 1
                 nowAttachment.Post()

End Function

No comments:

Post a Comment