Forum Discussion
Hi,
This is a strange behaviour. Can you specify the environment where you are running your Test Complete scripts? Are you running the scripts on any Windows server machine?
Long back I was using this script to close multiple instances of internet explorer and it used to work perfect for me. As I am not a C# or JavaScript guy I am posting this Vbscript code which you can modify according to your scripting language.
Sub CloseOpenBrowsers
Dim l_objBrowsers, l_BrowsersCount, l_ProcessName, objBrowser
l_objBrowsers = Sys.FindAllChildren("ObjectType","Browser")
l_BrowsersCount = Ubound(l_objBrowsers)
If l_BrowsersCount >= 0 then
For I = 0 to (l_BrowsersCount) - 1
l_ProcessName =l_objBrowsers(i).ProcessName
Delay 2000
Set objBrowser = Sys.Browser(l_ProcessName)
l_aobjPages = objBrowser.FindAllChildren("ObjectType","Page")
l_pagesCount = Ubound(l_aobjPages)
For J = 0 to l_pagesCount
If l_aobjPages(J).Exists then
l_aobjPages(J).Close()
Delay 500
End If
Next
Next
End If
End Sub
This script worked perfect for me. I had two instances of IE opened. One instance had two tabs opened and the other had three tabs opened. All the tab pages were closed and the instances of IE was closed. If you are working on a server you need to increase the delay and give some time for the browser to close.
For the other part of your problem. Once the IE has been terminated correctly can you run your scripts to executed on IE and post whether the script execution was successful?
Thank you,
but the problem was with my machine, the process was running even if I close it through scripts. where it was working as expected on other machines.
The priority of that service on my machine was set to 'High'. Ideally it should be set to 'Normal'.