Styrow.dev
Question 17 of 64

What are the different types of navigation commands?

Question

What are the different types of navigation commands?

Answer

Following are the navigation commands:

  1. navigate().back() - It doesn’t require any parameters and takes back the user to the previous webpage in the web browser’s history.

    Ex. driver.navigate().back();

    1. navigate().forward() - it lets the user to navigate to the next web page with reference to the browser’s history.

    Ex. driver.navigate().forward();

    1. navigate().refresh() - It lets the user to refresh the current web page there by reloading all the web elements.

    Ex. driver.navigate().refresh();

    1. navigate().to() - It lets the user to launch a new web browser window and navigate to the specified URL.

    Ex. driver.navigate().to(“https://google.com”);