注意:当我写完这个问题的时候,解决方案就出现了,但其他人可能会觉得这很有用,或者可以提供替代方案。如何等待一个元素在水豚中消失?
我看了下面的文章:
这个线程: https://groups.google.com/forum/#!topic/ruby-capybara/Mz7txv1Sm0U
这个博客:https://nulogy.com/articles/sleep-is-for-the-weak#.VNVcIrDF8vs
但仍然无法拼凑出对这个特定问题的答案。
我想等到页面上的元素消失后再继续。
此元素与我想单击的另一个元素重叠。当我尝试点击目标元素无论如何,我得到这个错误:
Capybara::Poltergeist::MouseEventFailed:
Firing a click at co-ordinates [1006, 322] failed. Poltergeist detected another element with CSS selector 'html body.widgets div#select2-drop-mask.select2-drop-mask' at this position. It may be overlapping the element you are trying to interact with. If you don't care about overlapping elements, try using node.trigger('click').
我尝试使用.trigger('click')
和.trigger(:click)
甚至,但它似乎没有任何效果。
我曾尝试一些其他的事情(“东西”是消失的元素):
@page.wait_until_thing_invisible
SitePrism::TimeOutWaitingForElementInvisibility:
execution expired
但是,如果“搜索”文本是持久性的,最终的while循环将导致无限循环。 – Srikanth 2015-03-25 11:40:10