Search code examples
rubywatirfirewatirautomated-tests

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.
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!


Solution

  • I usually do something like this,

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