12-09-2008, 11:32 PM
Your code should look like this, this is not the complete code but main you should look is how i cam saving a CSV File that is what you screen shot shows...
Code:
If Browser("Browser").Exist(3) Then
If Browser("Browser").WinButton("To help protect your security,").Exist(3) Then
Browser("Browser").WinButton("To help protect your security,").Click 1,1,micRightBtn
Browser("Browser").WinMenu("menuobjtype:=3").Select "Download File..."
Browser("Browser").Sync
End If
If Browser("Browser").Dialog("File Download").WinButton("Save").Exist(10) Then
Browser("Browser").Dialog("File Download").Activate
Browser("Browser").Dialog("File Download").WinButton("Save").Click
If Browser("Browser").Dialog("File Download").WinButton("Save").Exist(5) Then
Browser("Browser").Dialog("File Download").WinButton("Save").Click
End If
If Dialog("File Download").Dialog("Save As").WinEdit("File name:").Exist(10) Then
Set CurrentTest = QCUtil.CurrentTest
Dim sFolderName
sFolderName = CurrentTest.Name
sFileLoc = ResultScreenShotLocationPath_write & sFolderName & "\" & MakeUniqueName & ".csv"
Set fso = CreateObject("Scripting.FileSystemObject")
If not fso.FolderExists (ResultScreenShotLocationPath_write&sFolderName) Then
fso.CreateFolder( ResultScreenShotLocationPath_write&sFolderName )
End If
Dialog("File Download").Dialog("Save As").WinEdit("File name:").Set sFileLoc
Reporter.ReportEvent micPass, "CSV File", "File has been saved at locaiton "&sFileLoc
wait(3)
Dialog("File Download").Dialog("Save As").WinButton("Save").Click
If Dialog("File Download").Dialog("Save As").Dialog("Save As").WinButton("Yes").Exist(3) Then
Dialog("File Download").Dialog("Save As").Dialog("Save As").WinButton("Yes").Click
End If
If Browser("Browser").Exist(3) Then
Browser("Browser").Close
End If
Parameter("OutputCSVFileName_OUT") = sFileLoc
End If
Else