Micro Focus QTP (UFT) Forums
Handling Excel opened in an IE browser - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Handling Excel opened in an IE browser (/Thread-Handling-Excel-opened-in-an-IE-browser)



Handling Excel opened in an IE browser - eltee - 04-08-2011

Need little help in automating this scenario

I click on a link in my Web application page, which will launch a 'File Download' dialog box that asks the user to Open or Save the file. On clicking the Open button, an Excel sheet opens up in an IE browser. I need to catch hold of that screen, close it and get back to my Web application browser screen. Using Record and Play, the handling of the Excel browser screen is not being coded/shown.

Please help.

Thanks,
LT


RE: Handling Excel opened in an IE browser - Jay - 04-08-2011

you use/take help the below sample code for new excel sheet which is opening in the new IE
Code:
Browser("CreationTime:=1").Dialog("text:=its property").WinButton("text:=OK").Click
Browser("CreationTime:=1").Sync
If Browser("CreationTime:=1").WebElement("its property").exit then
msgbox "Excel file opened"
else
msgbox "Excel file not opened"
End if
Browser("CreationTime:=1").Close