In Selenium RC, I used the following code using Java for refresh on the browser:
selenium.refresh();
What is the equivalent code for refresh in WebDriver?
refresh command: This is the inbuilt method for performing page refresh operation provided by Selenium web driver. This command is the most commonly used command across test automation for performing a page refresh operation. Refresh command can be used in a simple way as mentioned below. driver.
navigate(). refresh(); Method, or can send key F5. Here, Web Page refresh can be achieved by using Actions class of the selenium WebDriver.
In this tutorial, we will learn four different ways to refresh the page in Selenium Webdriver. While automating a web application there may be certain cases wherein you may require to refresh the page.
The following is the equivalent code in Selenium WebDriver using Java:
driver.navigate().refresh();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With