08-26-2009, 11:35 PM
I have an export button in my application which opens the local disk Save dialog box.
first time when i was recording i selected a specific path where i wanted to Save. and when i re-run, the script is failing at the selection, because from second time onwards the same folder will be the default one for saving.
So my question is how can i handle this? can i set the folder all the time to my preferred folder.
Any help is highly appreciated.
Here is my code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Export the results to the local drive.
first time when i was recording i selected a specific path where i wanted to Save. and when i re-run, the script is failing at the selection, because from second time onwards the same folder will be the default one for saving.
So my question is how can i handle this? can i set the folder all the time to my preferred folder.
Any help is highly appreciated.
Here is my code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code:
fldr = "C:\LRP"
filespec = fldr &"\" & "LostProtectionData.xls "
If (fso.FileExists(filespec)) Then
fso.DeleteFile(filespec)
end if
' Export the results to the local drive.
Code:
Browser("IBM WebSphere Portal").Page("IBM WebSphere Portal").WebEdit("fromDate").Set "08/05/2009"
Browser("IBM WebSphere Portal").Page("IBM WebSphere Portal").WebEdit("toDate").Set "08/11/2009"
Browser("IBM WebSphere Portal").Page("IBM WebSphere Portal").WebButton("Find").Click
Browser("IBM WebSphere Portal").Page("IBM WebSphere Portal_2").WebButton("Export").Click
Browser("Browser").Dialog("File Download").WinButton("Save").Click
Browser("IBM WebSphere Portal").Page("IBM WebSphere Portal_2").Sync
'Dialog("Save As").WinComboBox("Save in:").Select "LRP" ' This code is failing in re-run..
Dialog("Save As").WinButton("Save").Click
Dialog("Download complete").WinButton("Close").Click