Function RemoveAttachFromQC(File_Name)
var_cnt= QCUtil.CurrentTest.Attachments.NewList(“”).count
For i= 1 to var_cnt
If QCUtil.CurrentTest.Attachments.NewList(“”).Item(2).Name =File_Name Then
Attachment = QCUtil.CurrentTest.Attachments.NewList(“”).Item(1).ID
QCUtil.CurrentTest.Attachments.RemoveItem(Attachment)
Else
Reporter.ReportEvent micFail,"Delete failed","Please provide the valid filename with extention"
End If
Next
End Function
File_Name=”Test.txt”
Call RemoveAttachFromQC(File_Name)
var_cnt= QCUtil.CurrentTest.Attachments.NewList(“”).count
For i= 1 to var_cnt
If QCUtil.CurrentTest.Attachments.NewList(“”).Item(2).Name =File_Name Then
Attachment = QCUtil.CurrentTest.Attachments.NewList(“”).Item(1).ID
QCUtil.CurrentTest.Attachments.RemoveItem(Attachment)
Else
Reporter.ReportEvent micFail,"Delete failed","Please provide the valid filename with extention"
End If
Next
End Function
File_Name=”Test.txt”
Call RemoveAttachFromQC(File_Name)