Selenium: how to provide reverse () navigation, as expected on different sites?

So i'm worried

webdriver.navigate().back();

in particular. AFter reading How does the back button work in a web browser?

it made me wonder how I can make the back button behave as expected?

There are different ways to reverse navigation. How would you determine which approach to use? Listen, are POST or GET executed? Listen to AJAX requests and plan an appropriate plan?

a) navigate back() (essentially hitting back button in firefox)
b) make GET request to the previous page url
c) click on "return to results" on current page

c a) back()sometimes do not work correctly for AJAX sites without breadcrumbs. or for POST search results, for example, if a warning message appears when you press back.

c b) my concern is that the url may not match,

ex) URL- hash sessionid

http://www.aa.com/results.php?sessionid=29756293changeseverytime

, , , , , - ( , "" ).

+5
1

, , , goBack, (, , )?

, AJAX, , AJAX lib. (, ).

+8

All Articles