I want to go back from one page(say B) to previous(say A) without refreshing it. I have a page B where if I am using it manually and I press backspace key manually it goes back to page A without refreshing, but when I am using
myElement.send_keys(Keys.BACK_SPACE)
on page B its redirecting me to page A and refreshing the page.
Note: I am using selenium for python.
Use the webdriver's back() method:
browser.back()
Alternatively, use the history.back() through "execute script":
browser.execute_script("history.back();")
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