This started on the user's list, but I'm cc'ing this to the developer's 
list...

If folks want to talk about user workarounds for supporting frames in 
Selenium... replies should go to Users' list.
If folks want to talk about developer implementation of supporting frames 
in Selenium... replies should go to Dev list.

Ajit Zadgaonkar wrote on 10/25/2005 02:25:51 PM:
> Is anyone aware of any work arounds, private fixes that would let 
> selenium work for webpages having frames / Iframes ?

There were some experimental patches submitted to the developer mailing 
list many months ago... Other than that... sorry, you'll have to hack the 
source.

Believe me, this is the #1 missing feature in Selenium... If someone can 
give us a high quality patch, we'll accept it and crank out a new release. 
(Which reminds me, if someone can dig up those experimental patches on the 
mailing list, confirm they work with a recent version of Selenium, and 
submit several some Selenium tests cases showing that it works in lots of 
different scenarios, I'd be very happy. Or at least, let us know what the 
remaining issues are with those patches.)

The sticky point with frames is how Selenium deals with pageLoad events... 
When you click on a button.... Selenium listens for a pageLoad event to 
fire before continuing on with the rest of the script. Selenium adds that 
listener as needed dynamically.... With frames, Selenium would need to add 
that listener on all sub frames...

Perhaps we could "punt" on the pageLoad issue if you just added a "wait" 
command after triggering any action that would cause a page load event. In 
that case, you just "hope" the new page is ready for new commands before 
the wait time period expires. This is how "version 0" of Selenium worked 
back in the day.

Other issues... Selenium itself uses frames (iframes, technically) to work 
its magic... The main Selenium code runs in the main window and controls 
the application under test in an iframe... Some sites do not like being 
"wrapped" in that iframe and expect to be the main "frame"... There is 
code in Selenium's codebase that lets you run your AUT in a separate 
window (not in an iframe), but I'm not sure how often if its used, or what 
issue there are with it.)

Another issue...  all the "element locator" commands like "type" and 
"click" use a search function to find an element on the page. Selenium 
currently expects to search one child iframe. These commands might need to 
be hacked to dynamically search all child window elements, whether they 
exist in frames or iframes (or frames within frames within frames, etc.) 
You might be able to skirt around this issue if you give a very precise 
"DOM element locator expression" that can find the element starting at the 
root element. For example:
"| click | document.frames[0].document.form[0].user_name_field ||

Good Luck and Patches Welcome!
- Jason
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to