View Source Improve this doc

getUrl

Get the url of current opened website.

Usage

1
2
browser.getUrl();

Example

getUrl.js
1
2
3
4
5
6
7
8
it('should get the url of the current page', function () {
browser.url('http://webdriver.io');
var url = browser.getUrl();
console.log(url);
// outputs the following:
// "http://webdriver.io"
});

Returns

  • <String>: current page url

Uses