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!

glepretre
  • 8,365
  • 5
  • 41
  • 56
Tim Hong
  • 2,602
  • 17
  • 23

1 Answers1

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)

Leo Gallucci
  • 15,165
  • 11
  • 66
  • 103
  • 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! =) ) – Tim Hong Aug 26 '14 at 01:44
  • 3
    [reference in protractor changelog.md](https://github.com/angular/protractor/blob/master/CHANGELOG.md#0120) 'browser is an instance of protractor. This was previously accessed using protractor.getInstance.' – nilsK Aug 26 '14 at 09:59
  • 1
    Thanks @nilsK for providing the reference! I updated the answer with it :) – Leo Gallucci Aug 26 '14 at 17:05
  • 1
    [reference to browser](http://www.protractortest.org/#/api?view=ProtractorBrowser) in Protractor API docs – xsdf May 05 '17 at 21:38