Watir and iframes?

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

armin@approximity.com wrote:

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?

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

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

In the end the bug was in the html-page I was testing.
It had invalid html. Thanks to tidy/validator I discovered it.