cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Regular Contributor

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 ... " 😉

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

7 REPLIES 7
Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Regular Contributor

Hi Robert,

I thought you will enjoy the error log! 🙂

 

Here is the capture of my log screen:

 

error log.png

 

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

Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Regular Contributor

Will do, thanks. I will report my experience here.

 

Thank you!

 

Dave

Highlighted
Community Hero

Hi,

 

I'm using the below function more-then year for closing the browser in our framework. This maybe useful for you too close the browser[not just IE you can input your browser process name or any process] and get the return value. 

 

To run this function : i.e  fn_closeProcess("iexplore")

 

function fn_closeProcess(str_ProcessName)
{
      var arr_Processes = null;
      
      if(str_ProcessName != "")
      {
            arr_Processes = Sys.FindAllChildren("ProcessName",str_ProcessName);
            
            if(arr_Processes != null)
            {
                  for(var b = 0 ; b < arr_Processes.length ; b++)
                  {
                        arr_Processes[b].Close();
                  } 
            }
            
            //if any missed process will finish off here
            var b_Object = Sys.WaitProcess(str_ProcessName, 1000);
            
            while(b_Object.Exists)
            {
                b_Object.Terminate();
                Log.Message("We have tried mutliple times to close the process [" + str_ProcessName + "] hence terminating the process.");
            } 
            
            var chkObj = Sys.FindChild("ProcessName",str_ProcessName);
            
            if(!chkObj.Exists)
            {
                  return true;     
            } 
            else
            {
                  Log.Message("We have tried terminating the process [" + str_ProcessName + "] but no luck. Need to have a LOOK!");
                  return false;
            } 
      }  
      return false;
} 

 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Highlighted
Regular Contributor

Hi Robert, so far your technique is working without any problems.  I am pretty sure I am not going to have any problems!

 

Thank you! 😄

Highlighted
Regular Contributor

Thank you, Shankar! 🙂

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

Participate!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors