[英]How do I use Watir::Waiter::wait_until to force Firefox to wait?
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.我需要做的是让 firewatir wait_until
有东西出现。
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.由于某种原因,我无法让wait_until
方法正常工作。
Thanks in advance!提前致谢!
I usually do something like this,我通常会做这样的事情,
browser.element_type(:id, "xxx").wait_until_present browser.element_type(:id, "xxx").wait_until_present
Instead of using the wait_until_present
option I used an until loop to wait for text to appear.我没有使用wait_until_present
选项,而是使用了一个 until 循环来等待文本出现。
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.绕过尝试使用它,因此它不符合我原来问题的答案,但希望它在这里供其他人使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.