RE: What is the main difference between driver.get(baseurl) and driver.navigate().to(baseurl)?

waiting for u r replay…

itsivaprasad Train Asked on September 4, 2014 in Selenium WebDriver.
Add Comment
3 Answers

Hi Siva,

Basically the Driver.Navigate returns a Navigation object. This object is implements an Interface called RemoteNavigation. RemoteNavigation has exposed methods to navigate, go back, go forward and refresh the page.

On the other hand Navigation is so essential to the WebDriver object that it is also implemented as a WebDriver.Get() call also. Basically they both do the same thing, however Webdriver.Get() makes DriverCommand.GET call on Browser directly and  in case of Driver.Navigate.to() makes the same DriverCommand.GET call using the RemoteNavigation command.

Its just a design difference, you can consider both as a synonym of each other.

Thanks
Virender

Professor Answered on September 4, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.