Issue Details (XML | Word | Printable)

Key: SEL-70
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Darrell DeBoer
Votes: 17
Watchers: 12
Operations

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

Ability to fully test frame-based applications

Created: 12/Apr/05 04:35 PM   Updated: 05/Feb/08 04:37 PM   Resolved: 13/Sep/06 01:05 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.8.0

File Attachments: 1. Text File 10267_iframe-patch.txt (3 kB) 05/Feb/06 09:58 PM - Patrick Lightbody



 Description  « Hide

Selenium only offers partial support for Frame-based applications. The required features would include:
1) Ability to locate an element in any frame.
2) Ability to locate an element in a particular frame?
3) Handle page transitions in any frame
4) Handle page transitions in a particular frame
5) Make sure variable like top, parent etc work correctly when running AUT in IFrame
6) Ensure that IFrames are handled as well as regular frames
7) Ensure that link "target" attribute is honoured

1, 3, and 5 are probably required in order to allow Selenium to test itself inside an IFrame.

Several patches have been supplied which provide bits of this functionality.



Sort Order: Ascending order - Click to sort in descending order
Darrell DeBoer added a comment - 12/Apr/05 04:38 PM

This patch adds some support for honouring the "target" attribute of a link in FireFox.

Index: selenium-browserbot.js
===================================================================
— selenium-browserbot.js (revision 417)
+++ selenium-browserbot.js (working copy)
@@ -549,7 +549,11 @@
if (needsProgrammaticClick && !preventDefault) {
// Try the element itself, as well as it's parent - this handles clicking images inside links.
if (element.href) {

  • this.currentWindow.location.href = element.href;
    + if (element.target) { + this.currentWindow.frames[element.target].location.href = element.href; + } else { + this.currentWindow.location.href = element.href; + }
    }
    else if (element.parentNode.href) {
    this.currentWindow.location.href = element.parentNode.href;

Darrell DeBoer added a comment - 15/Apr/05 11:53 PM

Patch which handles page-transitions within nested IFrames. Submitted by Steven Haberman.

Hi,

I've contracted on two straight projects in a row that use iframes heavily.
I haven't had the authority to change this, but I've at least had the
authority to test my own stuff with Selenium. Here's a patch I made to
selenium-browserbot.js which lets me click on things that cause pages to
load in iframes (even sub-iframes, sheesh) and have selenium keep going (it
originally would just stop as the iframe/sub-iframe event would not get
percolated up to selenium so it would think the page load was hanging).

Basically, I had to make a copy of SelfRemovingLoadListener and make one
specifically for frames - SelfRemovingLoadListnerFrames. Then when
installing the listeners, I call walkFrames and apply the listener to every
frame (recursive) in the document. The first frame that hears an event then
has its installed listener fired, which calls its wrapped function (e.g.
onloadCallback), and then uses walkFrames to uninstall all of the listeners
from the frames.

Thanks,
Stephen


Mike Williams added a comment - 06/Feb/06 06:38 AM

In implementing support for multi-frame (and potentially multi-window) apps, I propose we refactor the Selenium UI, separating it into one top-level window for Selenium suite, test, controls (and log?), and another for the AUT.


Mike Williams added a comment - 13/Sep/06 01:05 AM

Selenium Core now provides the capability to test multi-window or multi-framed applications.