07-07-2008, 03:50 PM
Hi Ankur,
I played around with the script now. But it is still very strange. After calling the Browser("..").Close-Method, QTP is waiting for a while until the browser is closed (which could mean up to 5 minutes waiting time). If I stop the running of the test during this waiting (right after calling the .close-method!) the test stops (of course ) and the Internet Explorer is closed immediately! So it seems that QTP has some problem here. IE seems to work fine...
Now the piece of code:
This is just the end of the script, but it is definitely the critical part. If I remove the lines from clicking on "save as excel" (which starts the download of an excel file) until the line with Browser.Exist, everything works fine.
So the opening of the file-save-dialog somehow distracts QTP...
Do you have any idea how this could be solved?
I played around with the script now. But it is still very strange. After calling the Browser("..").Close-Method, QTP is waiting for a while until the browser is closed (which could mean up to 5 minutes waiting time). If I stop the running of the test during this waiting (right after calling the .close-method!) the test stops (of course ) and the Internet Explorer is closed immediately! So it seems that QTP has some problem here. IE seems to work fine...
Now the piece of code:
Code:
Browser("Browser").Page("Page").Frame("CONTENT").WebEdit("ValueTextField21").Submit
Browser("Browser").Page("Page").Frame("CONTENT").Image("open as Excel file").Click
Dim temp_Report
temp_Report = "C:\Temp\temp_report.xls"
While Browser("Browser").Dialog("File Download").Exist(2)
Browser("Browser").Dialog("File Download").Activate
Browser("Browser").Dialog("File Download").WinButton("Save").Click
Wend
Dialog("File Download_2").Dialog("Save As").WinEdit("File name:").Set temp_Report
Dialog("File Download_2").Dialog("Save As").WinButton("Save").Click
If Dialog("File Download_2").Dialog("Save As").Dialog("Save As").Exist(1) Then
Dialog("File Download_2").Dialog("Save As").Dialog("Save As").Activate
Dialog("File Download_2").Dialog("Save As").Dialog("Save As").WinButton("Yes").Click
End If
Dialog("File Download").Close
If Browser("Browser").Exist(2) Then
Browser("Browser").CloseAllTabs
End If
This is just the end of the script, but it is definitely the critical part. If I remove the lines from clicking on "save as excel" (which starts the download of an excel file) until the line with Browser.Exist, everything works fine.
So the opening of the file-save-dialog somehow distracts QTP...
Do you have any idea how this could be solved?