Micro Focus QTP (UFT) Forums

Full Version: adding atachment to QC (ALM) - overwrite
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

during the test in QTP (launched from ALM) I am uploading generated excel file to the test run attachment using this function:

Code:
Function UpLoadAttachmentToQC(FilePath)
   Set ObjCurrentRun = QCUtil.CurrentRun.Attachments
   Set ObjAttch = ObjCurrentRun.AddItem(Null)
   ObjAttch.FileName = FilePath
   ObjAttch.Type = 1
   ObjAttch.Post
   ObjAttch.Refresh
End Function

Function is working great.

Question is how to update the function that it will overwrite the attachment when the name of the file is the same as the file allready attached?

(Currently i am checking the attachments and if there exist one with the same name i am deleting it before attaching a new one with the same name, but the solution is not a pretty one...)

What i am looking for is some kind of parameter of the method "Post" that will tell the function to overwrite existing attachemnt...
Hi,

Did you find any solution for your query?
If so please let me know the same.. It is very urgent

Thanks in advance