Home Ask Login Register

Developers Planet

Your answer is one click away!

Christian Shou February 2016

Strange behaviour with Navigate().back()

I'm facing an issue about the back function in selenium. When I call it, it does nothing but if I call it twice, it works perfectly. I've tried manually on my web browser and one back button is enought to go back.

Someone know why?

Thanks in advance!


Marc Sputnik February 2016

The behavior might be a result of a scripted page with some code for auto-refreshing, suppressing or overriding the back button event /action.

So you might:

  • debug the page and stop on any JavaScript execution
    • and ask for a correction/change if you are in control of the page
  • avoid the back-button-action from Selenium-framework, that simulates browser back navigation
    • use instead a given button (if available)
  • implement this "feature" in your own framework as a workaround to click it (always) twice to ensure successful back-navigation

Post Status

Asked in February 2016
Viewed 2,623 times
Voted 7
Answered 1 times


Leave an answer

Quote of the day: live life