Navigate commands These commands allow you to refresh,go-into and switch back and forth between different web pages. navigate().to() It automatically opens a new browser window and fetches the page that you Sample usage: specify inside its parentheses. It does exactly the same thing as the get() method. navigate().refresh() no parameters. Sample usage: It refreshes the current page. navigate().back() Needs no parameters Sample usage: Takes you back by one page on the browser’s history. navigate().forward() Needs no parameters Sample you forward by one page on the browser’s history. Closing and Quitting Browser Windows close() Needs no parameters Sample It closes only the browser window that WebDriver is currently controlling. quit() Needs no parameters Sample usage: It closes all windows that WebDriver has opened.
Navigate commands These commands allow you to refresh,go-into and switch back and forth between different web pages. navigate().to() Sample usage: It automatically opens a new browser window and fetches the page that you specify inside its parentheses. It does exactly the same thing as the get() method. navigate().refresh() Sample usage: no parameters. It refreshes the current page. navigate().back() Sample usage: Needs no parameters Takes you back by one page on the browser’s history. navigate().forward() Sample Needs no parameters you forward by one page on the browser’s history. Closing and Quitting Browser Windows close() Sample Needs no parameters It closes only the browser window that WebDriver is currently controlling. quit() Sample usage: Needs no parameters It closes all windows that WebDriver has opened.