You will have to use these browser navigation commands in Selenium automation script. Here in this chapter, we are going to discuss about various navigation commands. The navigate interface exposes the ability to move backwards and forwards in the browser’s history.
Navigate.To(URL) : This methods load a new web page in the current browser window. This is done using an HTTP GET operation and the method will block until the load is completeExample: driver.navigate().to("http://www.google.com");
Navigate.Back() : To move back a single "item" in the web browser's history. And it will not perform any action if you are on the first page viewed.
Example: driver.navigate().back();
Navigate.Forward() : To move a single "item" forward in the web browser's history. And it will not perform any action if we are on the latest page viewed.
Example : driver.navigate().forward();
Navigate.Refresh() : It refreshes the current web page
Example: driver.navigate().refresh();
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete