【发布时间】:2020-08-14 07:34:07
【问题描述】:
我正在尝试在 azure 管道中运行 selenium 测试,该测试在我的本地机器上运行良好:
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
chrome_exe= ChromeDriverManager()
driver = webdriver.Chrome(executable_path=chrome_exe.install(), options=options)
但是当我在管道中运行相同时,它会失败并出现以下错误。
E selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
E (unknown error: DevToolsActivePort file doesn't exist)
E (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
/opt/hostedtoolcache/Python/3.6.11/x64/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException
---------------------------- Captured stdout setup -----------------------------
---------------------------- Captured stderr setup -----------------------------
[WDM] - Current google-chrome version is 84.0.4147
[WDM] - Get LATEST driver version for 84.0.4147
[WDM] - There is no [linux64] chromedriver for browser 84.0.4147 in cache
[WDM] - Get LATEST driver version for 84.0.4147
[WDM] - Trying to download new driver from http://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip
[WDM] - Driver has been saved in cache [/home/vsts/.wdm/drivers/chromedriver/linux64/84.0.4147.30]
我手动转到它说的那条路径:没有这样的对象:chromedriver/84.0.4147.30 但如果我使用link 查询 它给出了相同的版本号
【问题讨论】:
标签: selenium-webdriver azure-devops selenium-chromedriver azure-pipelines