Selenium.refresh () equivalent code in Selenium WebDriver (Selenium 2) using Java

In Selenium RC, I used the following code using Java to update in the browser:

selenium.refresh(); 

What is the equivalent code for updating in WebDriver?

+8
java refresh selenium-webdriver selenium-rc
source share
3 answers

The following is equivalent code in Selenium WebDriver using Java:

 driver.navigate().refresh(); 
+14
source share

Another way to update with Ctrl + F5 is to use an instance of WebDriver and Actions, as shown below:

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

You can use:

 driver.navigate().refresh(); 

Look here, for example, How to refresh the current web page .

+3
source share

All Articles