Forum Discussion

royd's avatar
royd
Regular Contributor
8 years ago

Cannot obtain the window with the window class 'IEFrame' ... Error! Test are Failing!

While running test, I'm getting "Cannot obtain the window with the window class 'IEFrame', window caption '*' and index 0. See Additional Information for details. 10:19:55 Normal". 

 

I have searched in TestComplete forums and couldn't find a definitive solution. I have also checked Task Manager, there were no instances of Internet Explorer. One of the posts suggested to open several pages in Internet Explorer and checking it in the object browser to see all the pages are visible by TestComplete. I checked, and they're all visible. 

 

Here is my code (JScript):

while (Sys.WaitBrowser("iexplore").Exists)
    {
      Sys.WaitBrowser("iexplore").Close(5000);
    }

  Browsers.Item("iexplore", "", Browsers.pX86).Run("<url>");

 

I'm pretty sure somebody has an effective solution for this problem. Please help!

 

Thanks.

 

Dave

 

P.S.: Robert, if you are reading this, I wanted you to know my error log says: "I am the terror, that FLAPS in the night.  I am the script code ... " ;)

  • First of all, the Kudo is for the error message. :)

     

    Second of all, your code isn't matching the error you posted.  There's nothing in that bit of code that mentions an IEFrame class window so double check where the error is coming up.  All it's doing is running a particular URL in IE, no mention of interacting with an IEFrame window.

     

    Thirdly, the "Additional information" panel in the test log may contain some good info on what's going on.  Could you share what you have in there?

     

    My additional suspicion is this (as I'm running into something funky myself) in that, when you close the browser using the "Close" command, sometimes an instance of IE remains memory resident for which the call to "Close" doesn't actually work.  So, in my test cases, after a test case completes, I call the "close" command... and then, before I proceed to the NEXT test case, I call the following code:

     

                browser = Sys.WaitProcess('iexplore', 1000);
                while((browser.Exists)){
                    browser.Terminate();
                    browser = Sys.WaitProcess('iexplore', 1000);
                }

    This will actually terminate the specific process since there isn't an actual Window to close any more.  See if this helps.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    First of all, the Kudo is for the error message. :)

     

    Second of all, your code isn't matching the error you posted.  There's nothing in that bit of code that mentions an IEFrame class window so double check where the error is coming up.  All it's doing is running a particular URL in IE, no mention of interacting with an IEFrame window.

     

    Thirdly, the "Additional information" panel in the test log may contain some good info on what's going on.  Could you share what you have in there?

     

    My additional suspicion is this (as I'm running into something funky myself) in that, when you close the browser using the "Close" command, sometimes an instance of IE remains memory resident for which the call to "Close" doesn't actually work.  So, in my test cases, after a test case completes, I call the "close" command... and then, before I proceed to the NEXT test case, I call the following code:

     

                browser = Sys.WaitProcess('iexplore', 1000);
                while((browser.Exists)){
                    browser.Terminate();
                    browser = Sys.WaitProcess('iexplore', 1000);
                }

    This will actually terminate the specific process since there isn't an actual Window to close any more.  See if this helps.

    • royd's avatar
      royd
      Regular Contributor

      Hi Robert,

      I thought you will enjoy the error log! :)

       

      Here is the capture of my log screen:

       

       

      As you can see, the warning log indicates that since TestComplete things that the browser is already running, it fails to launch the browser.

       

      The first line of error has the following additional info:

      "The window with the specified attributes does not exist.

      Possible causes of the error"

       

      Following two errors basically indicates that the browser window does not exist. The reason being, after launching the browser I'm setting the browser window size and location, as well as zoom level 100% via script, as follows:

       

        Sys.Browser("iexplore").BrowserWindow(0).Position(1600, -180, 1400, 1060);
        Sys.Browser("iexplore").BrowserWindow(0).Keys("^0");

      Meanwhile, I will try your terminated method to see if that helps and keep you posted.

       

      Thanks,

       

      Dave

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        I'm willing to bet that the "Terminate" works.

         

        Just a note... continue to use "Close" at the end of each test case...but at the start up of the next test case, before running the browser, definitely use the "terminate" code that I posted.