driver.url is the current url, so it effectively refreshes the page.

You can obviously customise my example to loop as many times as you 
like, but I'd recommend avoiding infinite loops.
The "refresh" should not be necessary because the first line executed on 
a retry is
driver.get "https://example.com/"
thus negating the need to refresh the page.

-- 
Posted via http://www.ruby-forum.com/.