Should I use browser or ptor = protractor.getInstance()?
Asked Answered
K

1

19

I watched this video (https://www.youtube.com/watch?v=idb6hOxlyb8) which was uploaded Aug 2013. It claims that we should use

ptor.get(url)

rather than

browser().navigateTo(url)

in future. But when I look at docs on the protractor home page (on git hub) and their newest examples are still using browser.

I am wondering if any one knows the movement to use

var ptor = protractor.getInstance()

still happening?

Thank you very much in advance!

Koffler answered 26/8, 2014 at 0:44 Comment(0)
J
36

Using ptor is obsolete, you should switch to browser from now on.

Regarding the modern way to navigate to a page, use: browser.get(url)

If is not an angular page then browser.driver.get(url)

Jovitajovitah answered 26/8, 2014 at 1:20 Comment(4)
I see. Thank you very much for your reply. Could you please give a reference to say that is obsolete? (It does look that way, I just would like to have a confirmation. Thank you! =) )Koffler
reference in protractor changelog.md 'browser is an instance of protractor. This was previously accessed using protractor.getInstance.'Pouch
Thanks @Pouch for providing the reference! I updated the answer with it :)Jovitajovitah
reference to browser in Protractor API docsGravedigger

© 2022 - 2024 — McMap. All rights reserved.