Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Navigational Commands

WebDriver provides some basic Browser Navigation Commands that allows the browser to move backwards or forwards in the browser's history.We can access the
navigation methods provided by WebDriver by typing driver.navigate().

Commands Description Syntax Accepts Parameter Returns

This method Loads a new web


Navigate To: page in the current browser driver.navigate().to("https://www.google.com"); Accepts String as a parameter Returns Nothing.
window.

This method does the same


Refresh Command: operation as clicking on the driver.navigate().refresh(); Accepts Nothing as a parameter Returns a Nothing.
refresh Button of any browser.

This command is used to return to


Back Command: the previous page in the browser’s driver.navigate().back(); Accepts Nothing as a parameter Returns a Nothing.
history.

Move forward page using the


Forward Command driver.navigate().forward(); Accepts nothing as a parameter Returns a Nothing.
Forward () command.

You might also like