Issue Details (XML | Word | Printable)

Key: SEL-639
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Haw-Bin Chai
Votes: 0
Watchers: 0
Operations

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

openWindow Doesn't Work in Safari 4 Beta

Created: 06/Mar/09 11:29 AM   Updated: 30/Nov/09 11:52 AM
Component/s: Pop-Up Windows
Affects Version/s: 1.0-beta-2
Fix Version/s: None

File Attachments: 1. Text File currentDocument.patch (0.7 kB) 12/Oct/09 07:59 AM - chandra sekhar
2. Text File SEL_639_Patch.txt (3 kB) 22/Nov/09 07:01 AM - chandra sekhar

Issue Links:
Dependency
 


 Description  « Hide

All of the Core tests that use the openWindow command fail with the following message:

Result of expression 'openedWindow' [undefined] is not an object

It appears that this call in selenium-browserbot.js returns undefined:

var openedWindow = myOriginalOpen(url, windowName, windowFeatures, replaceFlag);

Which is surprising. Potentially a Safari bug, or perhaps some kind of new security mechanism in Safari?



Sort Order: Ascending order - Click to sort in descending order
Andras Hatvani added a comment - 06/Mar/09 11:32 AM

Probably related...?


Haw-Bin Chai added a comment - 06/Mar/09 11:33 AM

Ok , duh, you need to make sure "Block Pop-Up Windows" is unchecked. Which allows the window to open.

However, there's still some trouble with waiting for the popup - looks like some kind of Javascript type conversion error.


Ivo Krab added a comment - 22/Apr/09 04:29 AM

Look at SEL-572 for a vary probable fix of this problem. The thing is, openWindow() commands incorrectly do not record the ID of the opened window in the selenium.browserbot.openedWindows object that is used to find windows, UNLESS the browser is IE in HTA mode... Drove me crazy before I understood.

Please vote for SEL-572 to get this fix in ASAP!!!


chandra sekhar added a comment - 12/Oct/09 07:59 AM

checking for 'currentDocument == null' inside BrowserBot.prototype._isSameDocument(), and modified it to return false if currentDocument is null.
Similarly, modified getReadyState() to check for 'currentDocument == null' and to return null if currentDocument is null.

Later, ran the selenium-core tests against safari-4, and the previously failed tests with error message currentDocument [null] are passing.

Let me know if this solution is okay?
Or, do you have any other suggestions to fix this problem?


chandra sekhar added a comment - 12/Oct/09 08:07 AM

updated wrong jira issue. the patch is related to: http://jira.openqa.org/browse/SEL-680


chandra sekhar added a comment - 12/Oct/09 08:20 AM

@Ivo Krab: Does the patch for http://jira.openqa.org/browse/SEL-572 fixes this issues also?


chandra sekhar added a comment - 22/Nov/09 07:01 AM

Analysis:

doClick() // like <a href="index.html" _target="_blank">link1</a>
=> _modifyElementTarget()
=> openWindow() // open window is called on empty url.
=> FireEventOnElement()

==========

Fix contains:
1. overriding _modifyElementTarget() for SafariBrowserBot and when tagType is "a", it opens window on element.href instead of blank
2. openWindow() stores the reference to opened window.


Jennifer Bevan added a comment - 30/Nov/09 11:51 AM

Submitted SEL_639_Patch.txt in revision 7738.

Chandra, you asked about submitting SEL_639_Patch.txt only – what is currentDocument.txt and is it still relevant?


Jennifer Bevan added a comment - 30/Nov/09 11:52 AM

okay, it looks as though currentDocument.patch is contained within SEL_639_Patch. In this circumstance, can you remove previously uploaded patches (for posterity's sake )

-Jen