History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SEL-323
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Matthew Purland
Reporter: Jeantine Mankelow
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Selenium

waitForPopup doesn't work in firefox

Created: 24/Sep/06 09:18 PM   Updated: 08/Jun/07 04:52 PM
Component/s: Pop-Up Windows, Waiting
Affects Version/s: 0.8.0
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment:
Browser: Firefox 1.5.06
Webserver: jakarta-tomcat-5.5.9
Java version: jdk1.5.0_06
OS: Linux


 Description  « Hide
Even though I have installed the readyState plugin, waitForPopup is not waiting.

Using the javascript debugger I can see that i!selenium.browserbot.getCurrentWindow().document.readyState evaluates to true. The property exists but is unassigned. If I comment out this check in the doWaitForPopup function everything works fine.

Unfortunately there doesn't seeem to be anyway to distinguish between an unassigned variables. Perhaps you could try and assign the readyState to a variable and surround this in a try catch in which you return true.

 All   Comments   Work Log   Change History      Sort Order:
Jeantine Mankelow - 24/Sep/06 09:22 PM
oops I mean to say "Unfortunately there doesn't seeem to be anyway to distinguish between undefined and unassigned variables."

Martin Buechler - 14/Oct/06 06:02 AM
I see this issue is still unassigned. I have the same problem with waitForPopup when testing the core functionality in our webapp. The popup 'detailSatellite' is opened inside a nested frame. To reproduce, please execute the following TestSearchAndBook.html with SIDE and BaseURL http://www4.hrs.de
-------8<------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TestSearchAndBook</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">TestSearchAndBook</td></tr>
</thead><tbody>
<tr>
        <td>open</td>
        <td>/</td>
        <td></td>
</tr>
<tr>
        <td>type</td>
        <td>document.searchForm.location</td>
        <td>berlin</td>
</tr>
<tr>
        <td>clickAndWait</td>
        <td>//div[5]/input</td>
        <td></td>
</tr>
<tr>
        <td>clickAndWait</td>
        <td>link=Berlin - Deutschland</td>
        <td></td>
</tr>
<tr>
        <td>pause</td>
        <td>10000</td>
        <td></td>
</tr>
<tr>
        <td>click</td>
        <td>link=Berolina Airport</td>
        <td></td>
</tr>
<tr>
        <td>pause</td>
        <td>10000</td>
        <td></td>
</tr>
<tr>
        <td>waitForPopUpAndWait</td>
        <td>detailSatellite</td>
        <td>30000</td>
</tr>
<tr>
        <td>selectWindow</td>
        <td>detailSatellite</td>
        <td></td>
</tr>
<tr>
        <td>clickAndWait</td>
        <td>initBooking</td>
        <td></td>
</tr>

</tbody></table>
</body>
</html>
------->8-----------------------------






Martin Buechler - 16/Oct/06 04:24 AM
Ok, my comment was OT, sorry. My problem is related to the overwriting of window.open in selenium-browserbot.js:

The reason for the failing of waitForPopup is: The window-object of the window.open-call from a frameset's frame is NOT the window-object selenium is listening to. The new popup window cannot be found because it's originating window has never been 'modified' by selenium, therefore selenium is not reacting on opening window-objects introduced by i.e. framesets. BrowserBot just overwrites the open-method of the top window, which is IMHO not enough; but I must admit I am not deep enough into seleniums inner works to provide a patch. So, here's the approach from the other end of the AUT:

Instead of using window.open I am using top.open and waitForPopup is working now. BUT, this is not the way our app is specified. It is integrated into many sites into its own iframe and we have to avoid to rely on anything outside our scope. One possible solution is to modify the behaviour if we are running under selenium for now...

Christian Theune - 16/Oct/06 09:43 AM
I see this problem too. However:

It happens on both Selenium 0.7 and 0.8 with both FF 1.5.0.7 and 2.2rc. But, the readyState flag does not evaluate to true. Removing the whole section (as indicated by the original poster) does not help either.

Nelson Sproul - 17/Oct/06 12:48 AM
I wonder if using proxy injection mode would help in this case, since PI mode intercepts window.open in all windows and frames.