Forum Discussion

heidi_n's avatar
heidi_n
Regular Contributor
8 years ago
Solved

How to fix "The Internet Explorer browser was not closed after the loop iteration was finished"?

I am running TC 12.20 and have prepared web browsers (per: http://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/internet-explorer.html) IE Version is 11.0.9600.18...
  • tristaanogre's avatar
    tristaanogre
    8 years ago

    You should have, in your project, probably in the "Advanced" folder, a Script project object.  If you don't already have a script code unit there, add one by right clicking on the Script object and selecting "Add -> New Item".  Give it a meaningful file name.

     

    Then, take what I wrote and paste it into the unit as a new function.  Please note what I wrote is code written assuming JScript/JavaScript code syntax.  I don't know what code language your project is created in so you will have to adapt it accordingly.  The full function for my syntax would be

     

     function killIEProcess() {
        var ieProcess = Sys.WaitProcess('iexplore*');
        while (ieProcess.Exists) {
            ieProcess.Terminate();
            ieProcess = Sys.WaitProcess('iexplore*', 10000);
        }
    }

    Then, in your keyword test, after that Delay call for 5000 ms, add a the "Run Script Routine" operation.  You will be prompted to specify what code unit and available test to select.  Point to the function that you just created and that should work then for you.