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)
Get current URL of browser
Asked Answered
I found this link, might be helpful: code.google.com/p/selenium/wiki/JsonWireProtocol#/session/… –
Bookstand
Is standard method not working here? selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/… –
Downwash
I'm working with nodeJS –
Bethanie
driver.get("http://www.google.com")
.then(function() {
return driver.getCurrentUrl();
})
.then(function(currentUrl) {
// work with the current url of browser
});
To show you must to use toString:
var currentURL = driver.getCurrentUrl().toString();
console.log("***>>> getCurrentUrl: "+currentURL);
Actually when i use your code i am getting ManagedPromise::1143 {[[PromiseStatus]]: "pending"} –
Exoergic
© 2022 - 2024 — McMap. All rights reserved.