Micro Focus QTP (UFT) Forums

Full Version: Web
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a command to close all the potentially open browsers before you begin your script run?
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
Thanks. It works. Where did you get that?
I think you can also use this to close all the IE's

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