Micro Focus QTP (UFT) Forums
To save pdf from QTP - 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: To save pdf from QTP (/Thread-To-save-pdf-from-QTP)



To save pdf from QTP - Nagu - 05-25-2009

Hi

In my application i have a scenario to save a pdf to my local machine from application when these pdf's are available in different kind of reports whereas for 2 reports pdf name is same i am automating this scenario to save a pdf to local machine later verifying the pdf manually.The problem now is when i am running my script for other report which has the same pdf name i get the error file is already there in this location do you want to replace?.How i can handle this?.Is there anything to save a file under particular location.

I have done something like this:


Code:
dialogname="File Download"
    
Set o = Browser("").Dialog("text:="&dialogname)
    If o.Exist Then
        Report Environment("fname"),  "check", "dialog" & dialogname & " was found"
        o.Winbutton("text:=&Save").click
        Dialog("text:=File Download").Dialog("text:=Save As").Winbutton("text:=&Save").Click
    Else
        msg = "dialog " & dialogname & " doesn't exist"
        ReportMessage reportName, msg, micFail
        Exit Function
    End If