Showing posts with label Automate QC. Show all posts
Showing posts with label Automate QC. Show all posts

Monday, May 6, 2013

Remove an attachment from QC Through QTP

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)

Upload a file as Attachments To QC

Function UpLoadAttachToQC(File_Path)
    Set ObjCurrentTest = QCUtil.CurrentTest.Attachments
    Set ObjAttch = ObjCurrentTest.AddItem(Null)
    ObjAttch.FileName = File_Path
    ObjAttch.Type = 1
    ObjAttch.Post
    ObjAttch.Refresh
End Function
 

File_Path=”D:\test.txt”
 

Call UpLoadAttachToQC(File_Path)

AI in Software Testing: How Artificial Intelligence Is Transforming QA

For years, software testing has lived under pressure: more features, faster releases, fewer bugs, smaller teams. Traditional QA has done her...