This has been a known issue forever, but I couldn't find a JIRA issue on it, so I'm filing one now. We intercept calls to window.open, replacing window.open a function of our own devising, but if a call to window.open happens before we can replace it, the window will open without our knowledge, and we'll have no record of its id/name.
There's an interesting workaround I just learned about however:
http://www.irt.org/script/782.htm
winHandle = window.open('','windowName');
The first parameter (the url) is passed as an empty string, which should result in the contents of the window remaining unchanged.
In my projects here, as a workaround, I instructed the users to getEval("window.open('', 'foo')") and then selectWindow("foo") to open that window. We should consider adding functionality like this directly into selectWindow.
My task was:
Select a (named) popup window opened via the onload event in the java rc.
Problem:
The window is opened via <body onload="window.open(xxx, dsw_popup,...)">.
Selenium does not know about these popup windows as it is unable to modify open function.
Hence it is inivisble for all storeWindowNames or other selenium functions.
As solution this simple code worked:
public void selectPopUp(){
selenium.openWindow("","dsw_popup");
selenium.selectWindow("dsw_popup");
}
insteadof only selectWindow. That easy!
Maybe include this in core if it is feasible