Forum Discussion

rmaney's avatar
New Contributor
5 years ago

How to force stop a CBT run session apart from "Sys.Browser().BrowserWindow(0).Close()"

I am running a few tests on web application. Assume there is situation where remote connection was successful but for some reason browser did not open ( I have observed this situation), now how do I ...
  • sonya_m's avatar
    5 years ago

    Hi rmaney I see that you got a solution from the Support Team. Let me post it here - 



    ...the issue happens because the error is raised before the Sys.Browser().BrowserWindow(0).Close() call, and the execution of the test item is interrupted according to the project option. This is the expected behavior, TestComplete works in this way. So, you can use the OnStopTest event handler ( to close the browser, e.g. like this:

    def EventControl1_OnStopTest(Sender):
        browser = Sys.WaitBrowser()
        if (browser.Exists):



    Glad that it worked!