Watir 无法在 Firefox 中定位包含元素的框架,但在 IE 中工作正常
我有一个脚本:
BROWSER.frame( :name, 'FRAME_NAVIGATION' ).span(:text=>'foo').fire_event('onmouseup')
它单击树视图(框架内)的元素,该脚本在 IE 中效果很好,但是当我设置:
require 'watir'
Watir::Browser.default = 'firefox'
并运行它时,我得到:
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.
我在页面框架内的任何元素上都得到了这个。不仅仅是树视图。我也尝试过需要 firewatir,或者只是单独使用,但没有运气。
任何见解将不胜感激!
谢谢,
-M
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您没有正确使用框架方法。试试这个方法:
You're not using the frame method correctly. Try this way:
您可以通过添加 BROWSER.show_frames 调用来诊断问题。这会告诉你 Firefox 认为它能看到什么。
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.