[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

watir and iframes?

armin

7/7/2005 4:50:00 PM

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

3 Answers

james_b

7/7/2005 5:05:00 PM

0

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.ru... - The Ruby Documentation Site
http://www.r... - News, Articles, and Listings for Ruby & XML
http://www.rub... - The Ruby Store for Ruby Stuff
http://www.jame... - Playing with Better Toys


armin

7/7/2005 5:43:00 PM

0

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

armin

7/8/2005 2:42:00 PM

0

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