gpt4 book ai didi

javascript - 守夜人 : An occurred error while retrieving a new session

转载 作者:数据小太阳 更新时间:2023-10-29 05:37:22 24 4
gpt4 key购买 nike

在我的 React 项目中,我想使用 nightwatch 作为测试工具。我实际上在 Windows 上使用 Nightwatch v1.0.4 和 selenium-server-standalone-3.9.1.jar。

这是我的配置(nightwatch.json):

{
"src_folders": [
"tests"
],
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path": "",
"disable_colors": false,
"test_workers": false,
"selenium": {
"start_process": true,
"host": "localhost",
"port": 4444,
"server_path": "./bin/selenium-server-standalone-3.9.1.jar",
"log_path": "./logs",
"cli_args": {
"webdriver.chrome.driver": "./bin/chromedriver"
}
},
"desiredCapabilities": {
"browserName": "chrome",
"acceptSslCerts": true
},
"test_settings": {
"default": {
"webdriver": {
"server_path": "./bin/chromedriver",
"cli_args": [
"--log",
"debug"
]
},
"disable_colors": false,
"screenshots": {
"enabled": false,
"path": ""
},
"request_timeout_options": {
"timeout": 60000,
"retry_attempts": 5
},
"default_path_prefix" : "",
"desiredCapabilities": {
"browserName": "chrome",
"acceptInsecureCerts": true
}
},
"chrome": {
"webdriver": {
"port": 9515,
"default_path_prefix": "",
"server_path": "./bin/chromedriver",
"cli_args": [
"--verbose"
]
},
"desiredCapabilities": {
"browserName": "chrome",
"loggingPrefs": {
"driver": "INFO",
"server": "OFF",
"browser": "INFO"
}
}
}
}
}

还有我的测试文件(tests/index.js):

const host = 'http://localhost:3000'

module.exports = {
'Demo test' : function (browser) {
browser
.url('http://google.com')
.waitForElementVisible('body', 1000)
.pause(5000)
.end();
}
}

当我运行 nightwatch 时,出现以下错误:

enter image description here

谁能告诉我我做错了什么?

最佳答案

您提到的 v2.9 的 ChromeDriver 版本已经很旧了。

截至 ChromeDriver 下载 page ,根据您的 Chrome 版本,您应该使用 2.36 以上的 ChromeDriver 版本 - 我推荐最新的 2.38

关于javascript - 守夜人 : An occurred error while retrieving a new session,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50131341/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com