How to refresh a page on browser using selenium-webdriver? How to refresh a page on browser using selenium-webdriver? ruby ruby

How to refresh a page on browser using selenium-webdriver?


For Capybara, I think Tommyixi's comment is the best:

visit current_path


As mentioned in a comment by @Nakilon, with non-Poltergeist drivers in Capybara use the following to refresh the current page:

page.driver.browser.navigate.refresh

But for a universal fix, use:

page.evaluate_script 'window.location.reload()'


You can use the Navigation#refresh method:

driver.navigate.refresh