运行 nightwatchjs 测试时出现 TypeError [ERR_UNESCAPED_CHARACTERS]
TypeError [ERR_UNESCAPED_CHARACTERS] when running nightwatchjs test
我刚刚将我的 chromedriver 从版本 74.x.x 更新到 76.x.x 并收到以下错误:
Error while running .isElementDisplayed() protocol action: TypeError [ERR_UNESCAPED_CHARACTERS]: Error while trying to create HTTP request for "/wd/hub/session/676ee244a59ce7cba8601d00582bbe13/element/[object Object]/displayed": Request path contains unescaped characters
at new ClientRequest (_http_client.js:115:13)
at Object.request (http.js:42:10)
at HttpRequest.createHttpRequest (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/http/request.js:112:55)
at HttpRequest.send (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/http/request.js:191:29)
at Promise (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/transport.js:189:15)
at new Promise (<anonymous>)
at Selenium2Protocol.sendProtocolAction (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/transport.js:187:12)
at Selenium2Protocol.runProtocolAction (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/jsonwire.js:61:17)
at Object.isElementDisplayed (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/actions.js:54:10)
at Selenium2Protocol.executeProtocolAction (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/transport.js:235:48)
我也在这个过程中将 nightwatch 从 1.1.13 更新到 1.2.1。
作为从 chrome 版本 74.x.x 到 76.x.x 更改的一部分,我 运行 进行了切换,ChromeDriver 现在以 W3C 标准兼容模式运行默认情况下(chrome驱动程序版本 75.0.3770.8)。
为了解决我现有代码库的这个问题,我必须将下面的 w3c 设置添加到我的配置文件中:
desiredCapabilities: {
browserName: "chrome",
chromeOptions: {
w3c: false
}
}
在上面注释的代码中,实现不正确所以添加
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions": {
"w3c": false,
"args": ["--headlesffs", "window-size=1280,800"]
}
}
我刚刚将我的 chromedriver 从版本 74.x.x 更新到 76.x.x 并收到以下错误:
Error while running .isElementDisplayed() protocol action: TypeError [ERR_UNESCAPED_CHARACTERS]: Error while trying to create HTTP request for "/wd/hub/session/676ee244a59ce7cba8601d00582bbe13/element/[object Object]/displayed": Request path contains unescaped characters
at new ClientRequest (_http_client.js:115:13)
at Object.request (http.js:42:10)
at HttpRequest.createHttpRequest (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/http/request.js:112:55)
at HttpRequest.send (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/http/request.js:191:29)
at Promise (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/transport.js:189:15)
at new Promise (<anonymous>)
at Selenium2Protocol.sendProtocolAction (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/transport.js:187:12)
at Selenium2Protocol.runProtocolAction (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/jsonwire.js:61:17)
at Object.isElementDisplayed (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/actions.js:54:10)
at Selenium2Protocol.executeProtocolAction (/Users/bradleystillwagon/Documents/dev/git/nightwatch_intellij/node_modules/nightwatch/lib/transport/transport.js:235:48)
我也在这个过程中将 nightwatch 从 1.1.13 更新到 1.2.1。
作为从 chrome 版本 74.x.x 到 76.x.x 更改的一部分,我 运行 进行了切换,ChromeDriver 现在以 W3C 标准兼容模式运行默认情况下(chrome驱动程序版本 75.0.3770.8)。
为了解决我现有代码库的这个问题,我必须将下面的 w3c 设置添加到我的配置文件中:
desiredCapabilities: {
browserName: "chrome",
chromeOptions: {
w3c: false
}
}
在上面注释的代码中,实现不正确所以添加
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions": {
"w3c": false,
"args": ["--headlesffs", "window-size=1280,800"]
}
}