Python Selenium
About Lesson

In this Python Selenium tutorial we want to learn about Selenium Navigation Commands in Python, using Selenium Navigation Command we are able to open a web page URL, navigate to other web page by clicking any element, Back, Forward and Refresh web page using browser’s history. As users of a web page, quite often, we use the browser’s Back and Forward controls to navigate between the pages of a single application, or sometimes, multiple applications. As a test script developer, you may  want to develop tests that observe the behavior of the application when browser navigation buttons are clicked, especially the Back button. For example, if you use your navigation button in a banking application, the session should expire and the user should be logged out. So, using the WebDriver’s navigation feature, you can emulate those actions.

 

 

First we need to create our Chrome Web Driver.

 

 

In here we are going to open Google website.

 

 

We want to find the locator of google search box, so we are using the name attribute, also we want to send some text or keys to the search box.

 

 

You can use this code for navigating back, forward and refreshing.

 

 

 

So all together this is the complete source code for this tutorial.

 

 

 

Run the complete code and this is the result.

Selenium Navigation Commands in Python
Selenium Navigation Commands in Python
Thank you for visiting my website! If you enjoyed the free courses, please consider supporting my works on Patreon.
Exercise Files
No Attachment Found
No Attachment Found