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

Key: SEL-166
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Aslak Hellesoy
Votes: 0
Watchers: 0
Operations

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

[PATCH] Popup windows that post to a redirecting URL crashes Selenium

Created: 12/Dec/05 08:17 AM   Updated: 16/Oct/06 02:19 AM
Component/s: Pop-Up Windows
Affects Version/s: 0.6
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
If a popup issues a post followed by a redirect, the this.recordPageLoad callback function will get called _after_ the popup is closed, and there will be no 'current' window.

The attached patch fixes this problem


 All   Comments   Work Log   Change History      Sort Order:
Aslak Hellesoy - 12/Dec/05 08:18 AM
It looks like attaching files is disabled in this JIRA, so I'm pasting it here instead:


Index: selenium-browserbot.js
===================================================================
--- selenium-browserbot.js (revision 1919)
+++ selenium-browserbot.js (working copy)
@@ -58,7 +58,13 @@
 
var self = this;
     this.recordPageLoad = function() {
- LOG.debug("Page load detected, location=" + self.getCurrentWindow().location);
+ LOG.debug("Page load detected");
+ // If a popup issues a post followed by a redirect, this callback
+ // function will get called _after_ the popup is closed, and there
+ // will be no 'current' window.
+ if(self.getCurrentWindow()) {
+ LOG.debug("location=" + self.getCurrentWindow().location);
+ }
         self.currentPage = null;
         self.newPageLoaded = true;
     };
@@ -238,7 +244,7 @@
         targetWindow = eval(evalString);
     }
     if (!targetWindow) {
- throw new SeleniumError("Window does not exist");
+ //throw new SeleniumError("Window does not exist:" + windowName);
     }
     return targetWindow;
 };