Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

watir and iframes?

49 views
Skip to first unread message

ar...@approximity.com

unread,
Jul 7, 2005, 12:49:49 PM7/7/05
to
Hi all,

did anybody use watir on a page with iframes?
Apart from this tiny problem I have watir looks very
impressive.

I got a simple page with one iframe.
How can I access the iframe-text content?
Does anybody have a simple example to share?

Thanks,
-Armin

James Britt

unread,
Jul 7, 2005, 1:04:47 PM7/7/05
to

The Watir user guide, installed as part of Watir, has an example:

"Watir allows access to frame objects by identifying them by their name
attribute. This is the form that Watir takes to access a frame:
ie.frame("menu")

To access individual objects within that frame, you prefix the object
using the Watir code above. If we had a hyperlink in the menu frame:
Click Menu Item, we could click it like this:
ie.frame("menu").link(:text, "Click Menu Item").click


See [installation dir]/watir_bonus/doc/watir_user_guide.html

James
--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys


ar...@approximity.com

unread,
Jul 7, 2005, 1:43:17 PM7/7/05
to
James, a big thanks for your help,
but it does not seem to work.

Does watir support iframes?

The html page looks like:
..

<IFRAME name="queryResultFrame"
src="queryresult.do?method=showQueryResult" width="100%" height="400"
scrolling="no" frameborder="0" marginheight="0"
marginwidth="0">
</IFRAME>
...

ie.frame("queryResultFrame") fails.

Does watir support iframes?

Thanks,
-A

ar...@approximity.com

unread,
Jul 8, 2005, 10:42:18 AM7/8/05
to
In the end the bug was in the html-page I was testing.
It had invalid html. Thanks to tidy/validator I discovered it.

0 new messages