8

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?

3 Answers 3

14

The following is the equivalent code in Selenium WebDriver using Java:

driver.navigate().refresh();
3

Another way to refresh by using Ctrl+F5: to use the WebDriver and Actions instance as below:

Actions actionObject = new Actions(driver);
actionObject.keyDown(Keys.CONTROL).sendKeys(Keys.F5).perform();
3

You can use:

driver.navigate().refresh();

Look here for example - How To Refresh Current Web Page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.