python - django pytest splinter selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
问题描述
I'm trying to use pytest-bdd and pytest-splinter together.
I use docker and docker-compose.
This is my pytest pluging:
sugar-0.9.1, splinter-2.0.0, mock-1.10.0, django-3.4.2, bdd-2.21.0, celery-4.2.1
It's my fixtures:
@pytest.fixture(scope="session")
def splinter_webdriver():
return "chrome"
@pytest.fixture(scope="session")
def splinter_headless():
return True
And if I try to run the tests, I get the following error:
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/lib/chromium/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
E (Driver info: chromedriver=2.38 (05121428cd0fc129e40a3694cf5405698236ad14),platform=Linux 4.9.122-1-MANJARO x86_64)
I install chromedriver
like this:
&& apk add chromium chromium-chromedriver
For this, most likely, the latest version is installed.
I tried many different options, but I still could not solve the problem.
Also, an obstacle in solving the problem was that I can not pass on all the options that I want.
Most of the answers I find relate to the use of pure Selenium or Splinter. But I'm interested in using exactly the pytest-splinter.
解决方案
推荐阅读
- c++ - 为什么通过打印星形矩形来移动第一行?
- r - 无法使用 tidy 从 aov 中获得额外的 p 值
- angular - 如何保护阵列以供 Firebase Firestore 中的用户访问?
- vue.js - 使用 AXIOS GET 和 VUE JS 检索 CSV 内容 - 返回超时错误
- javascript - 在反应中,我提出了 CORS 策略错误,所以我该如何处理它
- php - wopress 分页不适用于下一页或预览页面
- java - ForkJoinTask - 加入()与调用()
- r - 在 R 中一次创建多个具有特殊长度的向量
- javascript - 如何按不同的属性将对象列表分组到字符串中?
- api - 通过 DRF API 读取 .txt 文件