WebDriverError错误:Chrome无法启动:退出异常 [英] WebDriverError error: Chrome failed to start: exited abnormally
问题描述
我试图在ubuntu 14.04 vm上运行量角器测试(由google云计算),
出于某种原因,当我运行'量角器conf.js'时出现错误:
E / launcher - WebDriverError:未知错误:Chrome无法启动:异常退出
为了安装无头镀铬:
https://gist.github.com/alonisser/11192482
-
在运行量角器cons.js之前,我正在运行webdriver-manager start / b>当我运行'Xvfb -ac:2 -screen 0 1280x1024x16'时,它冻结时获得
'初始化内置扩展GLX' -
我也尝试将conf.js更改为
chromeOptions:{
args:[--headless, --disable-gpu,--window-size = 800x600]'
但量角器打印'开始'然后错误:'失败:未知错误:需要X显示对于键码转换,请考虑使用Xvfb' -
重要的是要提到它在一两个小时之前都运行良好。
然后我只是让我的Mac睡觉,当然这是退出vm ..
-
我正在同量角器运行相同的测试我的Mac和它的作品很棒。
问题与实例虚拟机上的chrome / chromeDriver有关。
非常感谢!!!
在AWS EC2机器中使用selenium + python 2.7 + chromedriver时遇到类似问题。在我的例子中,我使用了最新的无头特征,因此向ChromeOptions对象添加' no-sandbox '参数确实不错。
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('headless')
chrome_options.add_argument ('no-sandbox')
driver = webdriver.Chrome(chrome_options = chrome_options)
这个问题似乎是Chrome的权限问题。它不允许root用户在没有--no-sandbox标志
的情况下执行它
I'm trying to run protractor test on ubuntu 14.04 vm (by google cloud), for some reason when i run 'protractor conf.js' i get an error says:
E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
I followed this tasks in order to install headless chrome: https://gist.github.com/alonisser/11192482
Before running protractor cons.js, i'm running "webdriver-manager start"
When i run 'Xvfb -ac :2 -screen 0 1280x1024x16' its freeze when gets to 'Initializing built-in extension GLX'
I also tried change the conf.js to chromeOptions: { args: [ "--headless", "--disable-gpu", "--window-size=800x600" ]' but and protractor print 'start' then error: 'Failed: unknown error: an X display is required for keycode conversions, consider using Xvfb'
It's important to mention that it's all worked great, before a couple hours. then i just let my mac sleep, and of course it was exit the vm..
I'm running the same tests with protractor in my mac and its works great. the problem is related to chrome/chromeDriver on the instance vm.
thanks a lot!!!
I had a similar problem when using selenium + python 2.7 + chromedriver in a AWS EC2 machine.
In my case I was using the newest headless feature, so adding 'no-sandbox' parameter to the ChromeOptions object did the trick.
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('headless')
chrome_options.add_argument('no-sandbox')
driver = webdriver.Chrome(chrome_options=chrome_options)
The problem seems to be a permission issue with chrome. It does not allow a 'root' user to execute it without the --no-sandbox flag
这篇关于WebDriverError错误:Chrome无法启动:退出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!