Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom function ExitTest
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi ,
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
Reply


Messages In This Thread
Custom function ExitTest - by skadam - 11-03-2011, 01:40 PM
RE: Custom function ExitTest - by Ankesh - 11-03-2011, 03:48 PM
RE: Custom function ExitTest - by ravi.gajul - 11-03-2011, 05:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP Flex plug-in not identifying custom objects kamalteja 0 2,805 10-19-2012, 09:00 PM
Last Post: kamalteja

Forum Jump:


Users browsing this thread: 2 Guest(s)