Watir can't find button inside iframe

378 views
Skip to first unread message

James

unread,
Mar 5, 2009, 1:27:30 PM3/5/09
to Watir General
I'm just getting into Watir and finding I can do all sorts of great
things with it. However, I can't seem to get it to find a button
within an iframe. I can find radio buttons in iframes, but not
regular buttons.

This happens even on the "official" examples - for instance the
"Automating Gmail with Watir" example, if I run it, I get this error
when it tries to click the "Send" button:

1) Error:
test_gmaildemo(GmailDemo):
Watir::Exception::UnknownObjectException: Unable to locate element,
using :text,
"Send"
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
52:in `asser
t_exists'
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
284:in `enab
led?'
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
56:in `asser
t_enabled'
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
229:in `clic
k!'
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
215:in `clic
k'
c:/rubyfiles/googletest.rb:28:in `test_gmaildemo'

1 tests, 0 assertions, 0 failures, 1 errors

bwaybandit

unread,
Mar 6, 2009, 9:42:04 AM3/6/09
to Watir General
have u tried pointing to the frame and then walking down the dom?

eg: ie.frame(:name, 'xxx').button(:id, 'asdsa').click

James

unread,
Mar 7, 2009, 8:55:05 AM3/7/09
to Watir General
Thanks bwaybandit.

I never resolved the gmail example, but for my own use, I found that
the application was just getting ahead of itself and the button wasn't
always fast loading. The "wait_until" command did the trick for me.
Reply all
Reply to author
Forward
0 new messages