Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
WebDriver's driver.navigate() method provides some basic Browser Navigation Commands, such as back() and forward(), that allows the browser to move backward or forwards in the browser's history. Just like other WebDriver methods, we can also access these navigation methods by typing driver.navigate() in the Eclipse panel.
This method loads a new web page in the existing browser window. It accepts String as a parameter and returns void. The respective command can be written as:
driver.navigate().to("www.lambdatest.com");In WebDriver, the clickForward() method enables you to click on the forward button in an existing browser window. It does not accept any arguments and does not return any value. The following command takes you forward by one page in the browser's history:
driver.navigate().forward();You can use the command WebDriver.get() to go backward by one page on the browser's history. This method allows you to click on the back button in the existing browser window. This method neither accepts anything nor returns anything. This syntax for this command is as follows:
driver.navigate().back();The WebDriver's refresh method reloads the current web page in the existing one. The syntax for the command is as follows:
driver.navigate().refresh();KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.