Watir 无法在 Firefox 中定位包含元素的框架,但在 IE 中工作正常

发布于 2024-10-17 23:33:32 字数 612 浏览 7 评论 0原文

我有一个脚本:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无边思念无边月 2024-10-24 23:33:32

您没有正确使用框架方法。试试这个方法:

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

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

BROWSER.frame(:name => 'FRAME_NAVIGATION').span(:text => 'foo').fire_event('onmouseup')
誰ツ都不明白 2024-10-24 23:33:32

您可以通过添加 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文