Reputation: 1027
Which is best way to use in protractor ?
var driver = browser.driver;
driver.get("URL")
or
browser.get("URL")
browser.manage().timeouts().implicitlyWait(browser.params.implicitWaitTime);
Currently I have used second approach to open URL and perform any browser action. Should I change everything like first approach or my approach is nice to go ahead ?
Upvotes: 1
Views: 1586
Reputation: 3645
My two cents
browser.driver.get()
If not go for browser.get('')
browser.get understands the angular cycle and waits for the angular activity to finishfrom documentation - API Documentation
Navigate to the given destination and loads mock modules before Angular. Assumes that the page being loaded uses Angular. If you need to access a page which does not have Angular on load, use the wrapped webdriver directly.
browser.get()
then you dont need a implicit wait and ideally you should avoid using itUpvotes: 2