Micro Focus QTP (UFT) Forums
Web - 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: Web (/Thread-Web)



Web - Anna - 07-11-2008

Is there a command to close all the potentially open browsers before you begin your script run?


RE: Web - somisays - 07-11-2008

Hi Anna,
You can use the following code.
Code:
Set b=Description.Create
b("micclass").value="Browser"
Set obj=Desktop.ChildObjects(b)
msgbox obj.count
For i=0 to obj.count-1
c=obj(i).getroproperty("name")
msgbox (c)
obj(i).Close
Next



RE: Web - Anna - 07-11-2008

Thanks. It works. Where did you get that?


RE: Web - quickmy - 07-13-2008

I think you can also use this to close all the IE's

Code:
SystemUtil.CloseProcessByName("iexplore.exe")