Sys.Process("iexplore").Terminate() - Internet Explorer 9
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2012
08:16 PM
06-13-2012
08:16 PM
Sys.Process("iexplore").Terminate() - Internet Explorer 9
TestComplete 8.70
Windows 7
Internet Explorer 9
What could be the reasons that sometimes doesn't work "Terminate"
code:
----------------------------------------------
If Sys.Process("iexplore").Exists Then
Sys.WaitProcess("iexplore").Terminate()
aqUtils.Delay(4000)
Sys.Refresh()
End if
-----------------------------------------------
and as a result get error (attach error log: "2 running iexplore")
Windows 7
Internet Explorer 9
What could be the reasons that sometimes doesn't work "Terminate"
code:
----------------------------------------------
If Sys.Process("iexplore").Exists Then
Sys.WaitProcess("iexplore").Terminate()
aqUtils.Delay(4000)
Sys.Refresh()
End if
-----------------------------------------------
and as a result get error (attach error log: "2 running iexplore")
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2012
12:14 AM
06-14-2012
12:14 AM
Hi,
Try below code...
CloseAllIEProcess
Try below code...
Sub CloseAllIEProcess
CloseAllIEProcess
IExplore = Sys.FindAllChildren("ProcessName","iexplore")
If UBound(iexplore)>=0 Then
For i = UBound(iexplore) to LBound(iexplore) Step -1 ' <== iterate from top to bottom
iexplore(i).Terminate
Next
End If
End Sub
=================================
After terminating IE forcibly, if you run any script immediately, please add below code, this will take IE to home page...
If Sys.Process("iexplore").WaitWindow("#32770", "Windows Internet Explorer", 1, 1000).Exists Then
Sys.Process("iexplore").Window("#32770", "Windows Internet Explorer", 1).Window("DirectUIHWND", "", 1).Window("CtrlNotifySink", "", 8).Window("Button", "Go to your home page", 1).Click
End If
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2012
03:19 AM
06-14-2012
03:19 AM
Hi Anil,
Thanks, now works perfectly.
After Terminate I use:
Set iexplore = TestedApps.iexplore.Run()
URL = "Go to my home page"
Call iexplore.WaitPage("*", 2000).ToURL(URL)
If (Not iexplore.WaitPage("*", 20000).Exists) Then
Sys.WaitProcess("iexplore").Terminate()
Call Sys.Refresh()
TestedApps.iexplore.Run()
End If
Best Regards
Armands
Thanks, now works perfectly.
After Terminate I use:
Set iexplore = TestedApps.iexplore.Run()
URL = "Go to my home page"
Call iexplore.WaitPage("*", 2000).ToURL(URL)
If (Not iexplore.WaitPage("*", 20000).Exists) Then
Sys.WaitProcess("iexplore").Terminate()
Call Sys.Refresh()
TestedApps.iexplore.Run()
End If
Best Regards
Armands
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2012
07:58 PM
06-19-2012
07:58 PM
Thanks!! 🙂
