如何使用 Watir::Waiter::wait_until 强制 Firefox 等待?
我有一些按钮在添加用户时被禁用。
我需要做的是让 firewatir wait_until
出现一些东西。
我现在正在尝试使用它:
count = 10
while count > 0
browser.button(:name, "_eventId_addEmployee").click
Watir::Wait.wait_until_present {text.exist? newHireUsername}
end
count -= 1
end
由于某种原因,我无法让 wait_until
方法正常工作。
提前致谢!
I have some buttons that get disabled when adding a user.
What I need to be able to do is have firewatir wait_until
something is present.
I am trying to use this right now:
count = 10
while count > 0
browser.button(:name, "_eventId_addEmployee").click
Watir::Wait.wait_until_present {text.exist? newHireUsername}
end
count -= 1
end
For some reason I can't get the wait_until
method to work correctly.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通常会这样做,
browser.element_type(:id, "xxx").wait_until_present
I usually do something like this,
browser.element_type(:id, "xxx").wait_until_present
我没有使用
wait_until_present
选项,而是使用了until循环来等待文本出现。这绕过了尝试使用它,因此它不符合我原来问题的答案,但希望将其放在这里供其他人使用。
Instead of using the
wait_until_present
option I used an until loop to wait for text to appear.This by-passed attempting to use it so it does not qualify as an answer for my original question but want it here for others.