1. Navigate the refresh method
driver. navigate().refresh();
driver. navigate().refresh();
2. Get the current URL
driver.get(driver.getCurrentUrl());
3. Javascript Executor
JavascriptExecutor executor=(JavascriptExecutor) driver;
executor.executeScript("location.reload()");
JavascriptExecutor executor=(JavascriptExecutor) driver;
executor.executeScript("location.reload()");
4. Robot class
Robot robot=new Robot();
robot.keyPress(KeyEvent.VK_F5);
robot.keyRelease(KeyEvent.VK_F5);
Robot robot=new Robot();
robot.keyPress(KeyEvent.VK_F5);
robot.keyRelease(KeyEvent.VK_F5);