Watir::WaitWithRefresh
Watir::WaitWithRefresh extends Watir to include methods that will refresh the page until or while an element is present or a block is true.
Installation
gem install 'watir-wait_with_refresh'Usage
The wait methods can be added after requiring Watir:
require 'watir' #or 'watir-classic' or 'watir-webdriver'
require 'watir/wait_with_refresh'Refresh the page until an element is present:
element.refresh_until_presentRefresh the page while an element is present:
element.refresh_while_presentDo something after refreshing the page makes the element present:
element.when_present_after_refresh.textRefresh the page until a block evaluates as true:
browser.refresh_until{ browser.div.present? }Refresh the page while a block evaluates as true:
browser.refresh_while{ browser.div.present? }A timeout can also be specified for each of the methods:
element.refresh_until_present(5)