In protractor, globally available browser
object has two methods:
Returns the current absolute url f
As stated previously
the getLocationAbsUrl - returns a full path to the current location.
browser.get('http://angular.github.io/protractor/#/api');
expect(browser.getLocationAbsUrl())
.toBe('http://angular.github.io/protractor/#/api');
The getCurrentUrl is utilized in a promise (schedule) to retrieve the URL of the current page. Typically, you would only use the getCurrentUrl when scheduling.
webdriver.WebDriver.prototype.getCurrentUrl = function()
{
return this.schedule(new webdriver.Command(webdriver.CommandName.GET_CURRENT_URL),'WebDriver.getCurrentUrl()');
}