Forum Discussion

jkrolczy's avatar
jkrolczy
Regular Contributor
11 years ago

IE crashed / web page expires after performing Sys.Browser("iexplore").BrowserWindow(#).Close()


I am testing one of my company's web-based applications.



I have the main web page window.

From here, there is a drop-down menu which I select an item and another browser window opens.

Then there is a grid, and dbl-clk a row will open another browser window.



At this point I want to cleanup.

Close each Browser window that was opened.





Below is an exmaple of my code.

This should be a simple process.



 



strWndCaption1 = "*Mapping/Linking Details*";



obj1 = Sys.Browser("iexplore").Find("WndCaption", strWndCaption1, 10);



var bName1 = obj1.ObjectIdentifier;



Log.Message(bName1);



Sys.Browser("iexplore").BrowserWindow(bName1).Close();





aqUtils.Delay(2000);





strWndCaption2 = "*Client Item File Search*";



obj2 = Sys.Browser("iexplore").Find("WndCaption", strWndCaption2, 10);



var bName2 = obj2.ObjectIdentifier;



Log.Message(bName2);



Sys.Browser("iexplore").BrowserWindow(bName2).Close();



BrowserWindow(2) and BrowserWindow(3) are usually the ones I am trying to close.



If I execute the above code, after the first close,

the next window gets the reload/refresh IE spinning icon

and then the web page expired shows up. IE crashed is generated in Logs.





If I put a breakpoint after the first close, then resume

the next window behaves like it should and closes correctly.





I have tried the various ways to close an IE broswer window.



Sys.Browser("iexplore").BrowserWindow(bName1).Keys("^w");

Sys.Browser("iexplore").BrowserWindow(bName1).Keys("~[F4]");



Sys.Browser().BrowserWindow(bName1).Click(19, 17);

aqUtils.Delay(2000);

Sys.Browser("iexplore").BrowserWindow(bName1).SystemMenu.Click("Close");



Sys.Browser("iexplore").BrowserWindow(bName1).Close();



The same issue occurs after the first Broswer window closes.

Manually exevrything works fine.



I am wondering if maybe the Sys.Browser have a flaw in it ?

I have always used the Sys.Process("iexplore").

I have not tried this yet to verify but will do it after this thread submission.



Regards,

JamesK


 


2 Replies

  • jkrolczy's avatar
    jkrolczy
    Regular Contributor
    Solved for now:


    Using this code for starting the IE browser, any closing of browsers later caused IE to crash

    TestedApps.iexplore.Run(1, true);





    Switching to the code for starting the IE browser, any closing of browsers later worked fine.

    Browsers.Item(btIExplorer).Run();


  • jkrolczy's avatar
    jkrolczy
    Regular Contributor
    After more digging into this issue:



    I took the test flow, and reconstructed the whole process from starting up IE to closing the windows I was interested in.  Running the complete process test script, everything works fine.



    Embedding the appropriate code back into the existing framework, for the window closures, the issue is still there.



    I am quite sure the last code part is solid and  good, but I need to figure out what is going on in this framework from starting up IE to get the browser windows opened that causes the IE crash after closing the last opened browser window in the cleanup process.



    It was great to see the toggle for the Legacy IE process under Web testing !

    That came in useful for some debugging.



    That's it for now.



    This is a strange issue.