如何单击一个奇怪的链接,看起来像 watir 中的按钮 [英] How to click a strange link looks like button in watir
本文介绍了如何单击一个奇怪的链接,看起来像 watir 中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用 Watir 单击一个看起来像附加图像的按钮的链接.
I want to use the Watir to click a link that looks like a button attached the image.
我使用以下方法,但不起作用:
I use the following method,but doesn't works:
@browser.div(:id,"NetworkAnalysisTabPanel").div(:index,1).div(:index,1).ul(:index,1).li(:index,1).link(:index,2).click
注意:
@browser.div(:id,"NetworkAnalysisTabPanel").div(:index,1).div(:index,1).ul(:index,1).li(:index,1).link(:index,2).flash
工作正常,但单击在 IE 和 FF 中不起作用
is working fine but click is not working in IE and FF
链接如下所示:
像这样的 HMTL:
注意:我可以使用带有 clickAt 方法的 selenium IDE 单击元素
Note: I am able to click on the element using selenium IDE with clickAt method
推荐答案
试试这个(未测试):
browser.link(:class => "x-tab-strip-menu").click
如果您可以闪烁链接,但单击不执行您想要的操作,请参阅:如何找出触发了哪些 JavaScript 事件?
If you can flash the link, but click does not do what you want, see this: How to find out which JavaScript events fired?
这篇关于如何单击一个奇怪的链接,看起来像 watir 中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文