watir and iframes?

A

armin

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
 
J

James Britt

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
 
A

armin

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
 
A

armin

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top