Micro Focus QTP (UFT) Forums
Download Files from AUT using QTP script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Download Files from AUT using QTP script (/Thread-Download-Files-from-AUT-using-QTP-script)



Download Files from AUT using QTP script - qtptest - 10-26-2012

Hello,

Need the help for following scenario.

I need to download the files(XLS,PDF,DOC) present on website
(i.e AUT) using QTP script.The Files should save @ particular location on local machine using the Script.

How to write the qtp script for the above scenario.

Thanks.


RE: Download Files from AUT using QTP script - Ankesh - 10-26-2012

Please dont ask for code. We are hear to help you provided you are giving it a try.

What are you upto? What have you tried till now? What is the difficulty you are finding in writing the script?

Regards,
Ankesh


RE: Download Files from AUT using QTP script - qtptest - 10-27-2012

Hi Thanks please find the code below

Code:
systemutil.Run "C:\Program Files\Internet Explorer\iexplore.exe"
Browser("title:=about:blank").Navigate "about:blank"
Browser("title:=about:blank").Navigate "http://www.9th-direction.com/?p=233"

Set oLinks=Description.Create()
oLinks("micclass").value="Link"


set oAll=Browser("Software Testing Tutorial").Page("ISTQB Question Dump |").ChildObjects(oLinks)
cnt=oAll.count

'print cnt

For i=0 to cnt-1

  print oAll(i).Getroproperty("name")

  If oAll(i).Getroproperty("name")="ISTQB Sample Question Paper Dump 1" Then
   msgbox "Match Found"&i

   oAll(i).click

   exit for
  End If

Next

I am trying it on sample website..
http://www.9th-direction.com/?p=233
on this web site there is link ISTQB Sample Question Paper Dump 1
it is pdf file, when i reach here on the ie explorer there is popup blocker and i am not able to download the file.

I have tried it using send key method on dialog box of download, but @ rntime there is issue with ie explorer.
SO how to handle such scenarios.

Thanks,