Keo Strife Keo Strife - 4 months ago 75
Node.js Question

Get current URL of browser

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)

Answer
driver.get("http://www.google.com")
    .then(function() {
        return driver.getCurrentUrl();
    })
    .then(function(currentUrl) {
        // work with the current url of browser
    });
Comments