Hello ,

Try this out. The below function is to download the attachment of a
particular test case .

Function filedownload(QCTestInstance,sFolder)

filedownload=0


testname="testcasename"
 Set attachFact = QCTestInstance.Attachments
   Set attachcol=attachFact.NewList("")
   MsgBox "Number of Attachments found:="&attachcol.count

        Set fso=CreateObject("Scripting.FileSystemObject")


                        If attachcol.count =0 Then
                        
                        MsgBox "No attachments found for the selected testcase"
                        
                        Else
                        

                For i=1 To  attachcol.count
                
                'load the attachments to local drive
                
                attachcol(i).load True,""
                
                'copy the  file from temporary downloaded location to the 
toplace folder
                fso.CopyFile attachcol(i).filename 
,sFolder&attachcol(i).name(1),True
                
                'increment no. of files download
                
                filedownload=filedownload+1
                
                Next
                
                MsgBox "File/s download success"
                
                End If

End Function


Regards,
Gokul.

On Wed, Aug 29, 2012 at 4:36 PM, Ravi kiran <[email protected]> wrote:
> Ankit Nigam,
>
> can you pls send me the code. I tried in net but unable to get.
>
>
>
> On Tue, Aug 28, 2012 at 9:17 PM, Ankit Nigam <[email protected]> wrote:
>>
>> Try qc OTA. Testfactory and attachment type.
>>
>> On 8/28/12, Ravi kiran <[email protected]> wrote:
>> > hi,
>> >
>> > I have Test data sheet attached in the test plan module as attachment
>> > for
>> > one folder.I want to import sheet to local drive using QTP script.
>> >
>> > Thanks for your help
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > "QTP - HP Quick Test Professional - Automated Software Testing"
>> > group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> > http://groups.google.com/group/MercuryQTP?hl=en
>> >
>>
>> --
>> Sent from my mobile device
>>
>> --
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en



-- 
Thanks,
Gokul Krishna.

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to