Working with browser navigation
Browsers provide various navigation methods to access web pages from the browser history or by refreshing the current page with the back, forward, and refresh/reload buttons on the browser window's toolbar. The Selenium WebDriver API provides access to these buttons with various methods of WebDriver.Navigation
interface. We can test the behavior of the application when these methods are used.
Method |
Description |
---|---|
|
This method moves back to the page in browser history. |
|
This method moves forward to the page in browser history. |
|
This method reloads the current page. |
|
This method loads the specified URL in the current browser window. |
In this recipe, we will see browser navigation methods.
Getting ready
Create a new test that will get an instance of WebDriver
, navigate to a site, and perform some basic actions and verifications.
How to do it...
Let's create a test that calls various navigation...