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