Listening for browser back-navigation

The browser back-navigation event, as we have already seen, gets invoked when we use the driver.navigation().back() method. The browser goes back one level in its history. Just like all the other events, this event is associated with two methods:

public void beforeNavigateBack(WebDriver driver)

The preceding method is invoked before the browser takes you back in its history. The WebDriver that invoked this event is passed as a parameter to this method:

public void afterNavigateBack(WebDriver driver)

Just as in all the after <<event>> methods, the preceding method is invoked when the navigate-back action is triggered. The preceding two methods will be invoked irrespective of the navigation of the browser; that is, if the browser doesn't have any history and you invoke this method, the browser doesn't take you to any of its history. But, even in that scenario, as the event is triggered, those two methods are invoked.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.200.226