Node.js 获取浏览器的当前URL
在Selenium Nodejs中,如何获取我正在测试的页面的当前url(当我的测试脚本运行时,假设页面最初已被重定向)要显示您必须使用toString:Node.js 获取浏览器的当前URL,node.js,selenium,selenium-webdriver,webdriver,Node.js,Selenium,Selenium Webdriver,Webdriver,在Selenium Nodejs中,如何获取我正在测试的页面的当前url(当我的测试脚本运行时,假设页面最初已被重定向)要显示您必须使用toString: var currentURL = driver.getCurrentUrl().toString(); console.log("***>>> getCurrentUrl: "+currentURL); 我发现了这个链接,可能会有帮助:标准方法在这里不起作用吗?当我使用你的代码时,实际上我正在使用nodejsa,我正在获得
var currentURL = driver.getCurrentUrl().toString();
console.log("***>>> getCurrentUrl: "+currentURL);
我发现了这个链接,可能会有帮助:标准方法在这里不起作用吗?当我使用你的代码时,实际上我正在使用nodejsa,我正在获得ManagedPromise::1143{[[PromiseStatus]]:“pending”}
var currentURL = driver.getCurrentUrl().toString();
console.log("***>>> getCurrentUrl: "+currentURL);