HI Parineeti, to refresh a webpage, we either make use of Ctrl+f5 or Ctrl+R while using keyboard actions. Now we can imitate same keyboard action using ActionChains() method. ActionChains() method allows you to perform multiple keyboard actions in single command. Following lines of code explains how to use it:
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://www.google.com/")
time.sleep(5)
print("Before refresh")
ActionChains(driver)
.key_down(Keys.CONTROL)
.send_keys(Keys.F5)
.key_up(Keys.CONTROL)
.perform()
print("After refresh")
sleep(5)
driver.quit()