Watir can't locate frame which houses an element in Firefox but works fine in IE

791 views Asked by At

I have a script:

BROWSER.frame( :name, 'FRAME_NAVIGATION' ).span(:text=>'foo').fire_event('onmouseup')

which clicks on elements of a tree view (inside a frame) which works great in IE, but when I set:

require 'watir'
Watir::Browser.default = 'firefox'

and run it I get:

Failure/Error: 
BROWSER.frame( :name, 'FRAME_NAVIGATION').span(:text=>'foo').fire_event('onmouseup')
Watir::Exception::UnknownFrameException:
Unable to locate a frame using name and FRAME_NAVIGATION.

I get this with any elements inside a frame on my page. Not just the tree view. I've tried requiring firewatir as well, or just on its own with no luck.

Any insight would be greatly appreciated!

Thanks,

-M

2

There are 2 answers

0
satanas On

You're not using the frame method correctly. Try this way:

BROWSER.frame(:name => 'FRAME_NAVIGATION').span(:text => 'foo').fire_event('onmouseup')
0
Sabrina On

You may be able to diagnose the problem by adding a BROWSER.show_frames call. That would tell you what Firefox thinks it can see.