获取错误:WebDriverException:消息:未知错误:Chrome无法启动:异常退出。 (未知错误:DevToolsActivePort文件不存在)(该进程从chrome位置/ usr / bin / google-chrome开始不再运行,因此ChromeDriver假定Chrome崩溃了
在运行机器人脚本时出现上述错误: 这是在chrome浏览器中打开电子管的简单代码。 看起来像这样:
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${Browser} Chrome
${URL} https://www.youtube.com/
*** Test Cases ***
TC1
Open Browser ${URL} ${Browser}
Input Text name:search_query ted talk
Click Button id:search-icon-legacy
在ubuntu上 使用python2.7
我也尝试更新chrome和chrome驱动程序。 我不知道我在做什么错 请帮忙。
答案 0 :(得分:0)
您正在尝试使用robotframework-seleniumlibrary == 4.3.0&robotframework == 3.0.2
将robotframework-seleniumlibrary 4.3.0更新为3.0.1
pip安装robotframework-seleniumlibrary == 3.0.1
添加功能
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_experimental_option w3c ${False}
Call Method ${chrome_options} add_argument no-sandbox
Call Method ${chrome_options} add_argument disable-setuid-sandbox
Call Method ${chrome_options} add_argument disable-dev-shm-usage
Call Method ${chrome_options} add_argument disable-single-click-autofill
Wait Until Keyword Succeeds 2x 1s
... Create WebDriver Chrome alias=${Browser} chrome_options=${chrome_options}
Go To ${URL}
Input Text name:search_query ted talk
Click Button id:search-icon-legacy