Selenium:从chrome location/usr/bin/google chrome启动的进程不再运行,因此ChromeDriver假设chrome已经崩溃
我正在尝试在AmazonEC2Ubuntu20.04实例中安装和配置Selenium命令行运行程序。 但是在运行命令selenium端运行程序Mynew.side时,我遇到了以下错误Selenium:从chrome location/usr/bin/google chrome启动的进程不再运行,因此ChromeDriver假设chrome已经崩溃,selenium,selenium-webdriver,selenium-chromedriver,selenium-ide,selenium-grid,Selenium,Selenium Webdriver,Selenium Chromedriver,Selenium Ide,Selenium Grid,我正在尝试在AmazonEC2Ubuntu20.04实例中安装和配置Selenium命令行运行程序。 但是在运行命令selenium端运行程序Mynew.side时,我遇到了以下错误 info: Running Mynew.side FAIL ./MySuiteOne.test.js ● Test suite failed to run WebDriverError: unknown error: Chrome failed to start: exited abno
info: Running Mynew.side
FAIL ./MySuiteOne.test.js
● Test suite failed to run
WebDriverError: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
at Object.throwDecodedError (../../usr/local/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/error.js:550:15)
at parseHttpResponse (../../usr/local/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:560:13)
at Executor.execute (../../usr/local/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/http.js:486:26)
Test Suites: 1 failed, 1 total
但我可以向您保证,chrome安装在默认位置/usr/bin/google chrome)这是我从文件Selenium IDE导出的(.side),作为chrome浏览器的扩展名
{
"id": "6fe36969-3843-4f1d-ab08-c4c2887f44ed",
"version": "2.0",
"name": "Mynew",
"url": "https://opensource-demo.orangehrmlive.com/index.php/auth/login",
"tests": [{
"id": "f227a3fa-4d62-4a4d-9f11-8b461a727c23",
"name": "MytestOne",
"commands": [{
"id": "4c29844f-7f52-4b27-a20d-73eb392c3f09",
"comment": "",
"command": "open",
"target": "https://opensource-demo.orangehrmlive.com/index.php/auth/login",
"targets": [],
"value": ""
}, {
"id": "b19287f1-0dd4-426f-91dc-029e33c2768a",
"comment": "",
"command": "setWindowSize",
"target": "1050x708",
"targets": [],
"value": ""
}, {
"id": "7b1eb8bb-850a-426a-a037-715fab5e38a2",
"comment": "",
"command": "click",
"target": "id=txtUsername",
"targets": [
["id=txtUsername", "id"],
["name=txtUsername", "name"],
["css=#txtUsername", "css:finder"],
["xpath=//input[@id='txtUsername']", "xpath:attributes"],
["xpath=//div[@id='divUsername']/input", "xpath:idRelative"],
["xpath=//div[2]/input", "xpath:position"]
],
"value": ""
}, {
"id": "8888ace2-2c67-4b05-b113-aef8c69c6bdb",
"comment": "",
"command": "type",
"target": "id=txtUsername",
"targets": [
["id=txtUsername", "id"],
["name=txtUsername", "name"],
["css=#txtUsername", "css:finder"],
["xpath=//input[@id='txtUsername']", "xpath:attributes"],
["xpath=//div[@id='divUsername']/input", "xpath:idRelative"],
["xpath=//div[2]/input", "xpath:position"]
],
"value": "Admin"
}, {
"id": "ad27d038-0e59-4bfd-afb1-ae190c58960f",
"comment": "",
"command": "click",
"target": "id=frmLogin",
"targets": [
["id=frmLogin", "id"],
["css=#frmLogin", "css:finder"],
["xpath=//form[@id='frmLogin']", "xpath:attributes"],
["xpath=//div[@id='divLoginForm']/form", "xpath:idRelative"],
["xpath=//form", "xpath:position"]
],
"value": ""
}, {
"id": "8912fdd1-f7dc-4a6a-876e-4473d21a5198",
"comment": "",
"command": "click",
"target": "id=txtPassword",
"targets": [
["id=txtPassword", "id"],
["name=txtPassword", "name"],
["css=#txtPassword", "css:finder"],
["xpath=//input[@id='txtPassword']", "xpath:attributes"],
["xpath=//div[@id='divPassword']/input", "xpath:idRelative"],
["xpath=//div[3]/input", "xpath:position"]
],
"value": ""
}, {
"id": "1cae4fd9-ad05-41d5-886d-da15c80aa53f",
"comment": "",
"command": "type",
"target": "id=txtPassword",
"targets": [
["id=txtPassword", "id"],
["name=txtPassword", "name"],
["css=#txtPassword", "css:finder"],
["xpath=//input[@id='txtPassword']", "xpath:attributes"],
["xpath=//div[@id='divPassword']/input", "xpath:idRelative"],
["xpath=//div[3]/input", "xpath:position"]
],
"value": "admin123"
}, {
"id": "cdd370c8-3197-4484-8177-d38497d8e435",
"comment": "",
"command": "click",
"target": "id=btnLogin",
"targets": [
["id=btnLogin", "id"],
["name=Submit", "name"],
["css=#btnLogin", "css:finder"],
["xpath=//input[@id='btnLogin']", "xpath:attributes"],
["xpath=//div[@id='divLoginButton']/input", "xpath:idRelative"],
["xpath=//div[5]/input", "xpath:position"]
],
"value": ""
}, {
"id": "6a9375a3-b0f5-4139-b970-74e255008439",
"comment": "",
"command": "click",
"target": "id=welcome",
"targets": [
["id=welcome", "id"],
["linkText=Welcome Peter", "linkText"],
["css=#welcome", "css:finder"],
["xpath=//a[contains(text(),'Welcome Peter')]", "xpath:link"],
["xpath=//a[@id='welcome']", "xpath:attributes"],
["xpath=//div[@id='branding']/a[2]", "xpath:idRelative"],
["xpath=//a[contains(@href, '#')]", "xpath:href"],
["xpath=//a[2]", "xpath:position"],
["xpath=//a[contains(.,'Welcome Peter')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "20fb027f-f8c1-4dd1-825c-d6f0ed938baa",
"comment": "",
"command": "click",
"target": "linkText=Logout",
"targets": [
["linkText=Logout", "linkText"],
["css=#welcome-menu li:nth-child(3) > a", "css:finder"],
["xpath=//a[contains(text(),'Logout')]", "xpath:link"],
["xpath=//div[@id='welcome-menu']/ul/li[3]/a", "xpath:idRelative"],
["xpath=//a[contains(@href, '/index.php/auth/logout')]", "xpath:href"],
["xpath=//li[3]/a", "xpath:position"],
["xpath=//a[contains(.,'Logout')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "4ccf113b-b7bb-4ca9-b8be-acf7c90ade36",
"comment": "",
"command": "close",
"target": "",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "1943d405-1ba8-4bc5-b54e-6e4fe64708d7",
"name": "MySuiteOne",
"persistSession": false,
"parallel": true,
"timeout": 300,
"tests": ["f227a3fa-4d62-4a4d-9f11-8b461a727c23"]
}],
"urls": ["https://opensource-demo.orangehrmlive.com/index.php/auth/login"],
"plugins": []
}
请让我知道我遗漏了什么。您使用的chromedriver和chrome版本是什么?chrome版本91和chrome驱动程序90。我使用命令“npm install-g chromedriver”安装了chrome驱动程序。有没有办法用npm来更新?