Protractor browser.driver.getCurrentUrl vs browser.getCurrentUrl

I am running an Angular application and I am trying to get the current url when testing for protractor. Which one to use?

browser.driver.getCurrentUrl()or browser.getCurrentUrl()?

+3
source share
1 answer

If this is a test application of Angular - use browser, otherwise - browser.driver.

To quote @jmr from the corresponding github issue :

If you need to interact with a non-Angular page, you can access the wrapped web drive instance directly using browser.driver.


, , , Angular . , browser.driver , :

- , browser.driver AngularJS, . - .driver .

, browser.getCurrentUrl() .

+7

Source: https://habr.com/ru/post/1664378/


All Articles