Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a script to save to the local disk.
#1
Solved: 10 Years, 8 Months, 4 Weeks ago
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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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
Reply
#2
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi,
there must be an edit box for filename, you can directly set the required file path every time there.
e.g.
Code:
Dialog("File Download").Dialog("Save As").WinEdit("File name:").Set YourPath

Please see this for wrapping your post make it more readable

Reply
#3
Solved: 10 Years, 8 Months, 4 Weeks ago
Thankyou Saket

This works perfectly fine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Save scripts from QC to Local Disk-need help with code monsuer15 1 3,008 10-10-2017, 03:08 PM
Last Post: bela.chuphal
  Not able to click the save button in Save As window while downloading from SAP kathirvelnagaraj 0 2,300 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
  Save File1.xls as Text File1.txt with save as type - Text(Tab Delimited) Rupesh Singh 0 2,409 03-13-2013, 09:54 AM
Last Post: Rupesh Singh
  Error while creating object using description.create object in VB script SarodeGirish 5 5,806 06-19-2012, 05:30 PM
Last Post: ssvali
  I want to Save the excel file without a save as window cadari 2 3,978 02-03-2010, 10:54 PM
Last Post: cadari

Forum Jump:


Users browsing this thread: 1 Guest(s)