11-03-2011, 05:17 PM
(This post was last modified: 11-03-2011, 10:03 PM by ravi.gajul.)
Hi ,
you can use the below code and call the user defined function CloseApplicationAndTest() instead of ExitTest
This will close all the browsers open except quality center
Regards,
Ravi
you can use the below code and call the user defined function CloseApplicationAndTest() instead of ExitTest
Code:
Function CloseApplicationAndTest()
Dim intcounter
Set o=Description.Create
oDesc("micclass").Value="Browser"
intcounter=0
While Browser("micclass:=Browser","index:="&intcounter).exist(0) and intcounter<Desktop.ChildObjects(oDesc).count
If instr(1, Browser("micclass:=Browser","index:="&intcounter).getRoProperty("name"),"Quality Center") = 0 Then
SystemUtil.CloseProcessByHwnd( Browser("micclass:=Browser","index:="&intcounter).getRoProperty("hwnd"))
else
intcounter=intcounter+1
End if
wend
ExitTest
End Function
This will close all the browsers open except quality center
Regards,
Ravi