I have refreshed the browser in WebDriver using java as below code:
driver.navigate().refresh();
How can I do that by pressing Ctrl+F5 in WebDriver using Java?
The reload() method reloads the current document. The reload() method does the same as the reload button in your browser.
Using driver.navigate() command Selenium Webdriver provides inherent support for refreshing a webpage using its driver. navigate() command. This is by far the most preferred and widely used way of refreshing a webpage.
Most commonly used method for page refresh in Selenium is the driver. navigate(). refresh() method. Get method and navigate methods include the recursive ways to refresh a page in Selenium.
I think you can use the WebDriver and Actions instance as below:
Actions actionObject = new Actions(driver);
actionObject.keyDown(Keys.CONTROL).sendKeys(Keys.F5).keyUp(Keys.CONTROL).perform();
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