Outline

In this post we will dive into what webdriver API does in terms of navigation. Navigation is the first part of Webdriver API and we will cover all navigation methods such as .get(<url>), .navigate.to, .navigate.back(), .navigate.forward(), etc…

Audience

This post is designed for beginners who have little or no automation experience. At the end of this tutorial, you will have knowledge on Selenium Webdriver Navigation features.

Prerequisites

Nice to have: Before starting to read this post it is better to read previous selenium tutorials.

Selenium Webdriver Navigation Methods

Navigation methods is shown below figure. In this post I will go with method explanations then show their examples and usage.

navigation

.get (URL)

We can go to any URL with driver.get(“http://www.teknosa.com”) command.

.navigate.to(url)

We can go to any URL with driver.navigate().to(“http://www.teknosa.com”) command.

.navigate.back()

We can go back to previous page with driver.navigate().back() command.

.navigate.forward()

We can go forward from current page to last opened page with driver.navigate().next() command.

.navigate.refresh()

We can refresh the webpage with driver.navigate().refresh() command.

Navigation Example

Important Note:
Navigation of webdriver halts until the HTML of page is fully loaded but javascript is not included in this context. Thus, in some cases synchronization is required for error prone manipulation and interrogation.