Quick test professional

QTP Tips QTP codes QTP Faqs and more

Upload Attachments To QC

Function UpLoadAttachmentToQC(FilePath)

Set ObjCurrentTest = QCUtil.CurrentTest.Attachments
Set ObjAttch = ObjCurrentTest.AddItem(Null)
ObjAttch.FileName = FilePath
ObjAttch.Type = 1
ObjAttch.Post
ObjAttch.Refresh

End Function
FilePath=”C:\abc.vbs”
Call UpLoadAttachmentToQC(FilePath)

Author: Mohan Kakarla

Source: QC-OTA

September 24, 2008 - Posted by quicktestprofessional | Automating QC, QC-OTA | | 5 Comments

5 Comments »

  1. Hi Mohan,

    This is really Excellent site for the QTP Testers:-

    I have to (upload)attach screen shot in QC against some particular steps, if a condition is fulfilled I want to call that function and upload the attachment again the Test step in QC.

    Please have a look and let me know if you need more clarifications).

    Thanks

    Comment by Kamal | November 23, 2008 | Reply

    • Plz send me the code for attaching file to Testlab.
      my objective is to upload files after execution of all scripts(so i cant use QCutil.currentrun)..

      Thanks in advance.

      sakthivelraja

      Comment by Sakthivel Raja | October 26, 2009 | Reply

  2. Hi Mohan,

    Fantastic efforts!!

    I was able to upload attachment for the QCUtil.CurrentTest
    and QCUtil.CurrentRun. But I was not able to upload attachment for a particular ’step’ in the ‘Run Steps’ Please guide thru.

    Many Thanks

    Comment by Abrakh | June 9, 2009 | Reply

  3. Hi there,

    Well i am looking for the vb code to use in excel.

    My actual plan is to place a button in excel and once we click on the button the attachment of the excel file should get uploaded to selected test plan in the test lab module in the Quality Center.

    If u can provide me the code i would appreciate it.

    Thanks in Advance,

    Regards,
    Chatiu

    Comment by Chaitanya | August 18, 2009 | Reply

  4. Hello Mohan,

    Can you please help\guide me for an QTP script which creates User in Test Director (Quality Center).

    Regards
    Tahir

    Comment by Tahir | October 21, 2009 | Reply


Leave a comment