Browser Navigation Command

Navigation Commands are able open a web page URL, navigate to another web page or navigate back, Forward or Refresh the web page using browser’s history.


Given below are the Navigation commands for Selenium WebDriver.

1. Navigate.To()

This method is used to redirect to the new web page from the existing web page. It maintains browser history and cookies, unlike get method. It accepts string as a parameter and returns void.

driver.navigate().to(“https://demoapp1.tequality.tech/”);
 

2. Navigate.Forward()

This method takes to the forward page of the existing browser window. It neither accepts anything nor returns anything.

driver.navigate().forward();
 

3. Navigate.Backward()

This method takes to the backward page of the existing browser window. It neither accepts anything nor returns anything.

driver.navigate().back();
 

4. Navigate.Refresh()

This method is used to refresh or reload the current page in the existing browser window. It neither accepts anything nor returns anything.

driver.navigate().refresh();