In Selenium Nodejs, How can I get the current url of the page I'm testing (the moment my test script is running assume that the page initially has been redirected)
driver.get("http://www.google.com")
.then(function() {
return driver.getCurrentUrl();
})
.then(function(currentUrl) {
// work with the current url of browser
});