如何使用 Watir::Waiter::wait_until 强制 Firefox 等待?

发布于 2024-11-24 14:50:25 字数 347 浏览 4 评论 0原文

我有一些按钮在添加用户时被禁用。
我需要做的是让 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 技术交流群。

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

发布评论

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

评论(2

葬花如无物 2024-12-01 14:50:25

我通常会这样做,

browser.element_type(:id, "xxx").wait_until_present

I usually do something like this,

browser.element_type(:id, "xxx").wait_until_present

过度放纵 2024-12-01 14:50:25

我没有使用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.

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