Navigation Commands:
Navigation Commands are used to navigate window base actions in the
browser.
There are four types of Navigation Commands:
1. navigate().to()
Loads a new web page in the current browser window (replace the current URL with a new URL).
Syntax: object.navigate().to(“URL”);
Example: driver.navigate().to(“https://testingcolleges.blogspot.com/”);
Loads a new web page in the current browser window (replace the current URL with a new URL).
Syntax: object.navigate().to(“URL”);
Example: driver.navigate().to(“https://testingcolleges.blogspot.com/”);
2. navigate().forward()
It does the same operation as clicking on the forward button (→) of any browser.
Example: driver.navigate().forward();
It does the same operation as clicking on the forward button (→) of any browser.
Example: driver.navigate().forward();
3. navigate().back()
It does the same operation as clicking on the back button (←) of any browser.
Example: driver.navigate().back();
4. navigate().refresh()
To refresh the current web page.
Example: driver.navigate().refresh();
No comments:
Post a Comment