Micro Focus QTP (UFT) Forums

Full Version: To save pdf from QTP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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