05-25-2009, 11:58 AM
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:
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