Selenium:未知错误:由于页面崩溃而删除了会话

时间:2016-06-09 00:12:07

标签: java selenium-webdriver selenium-chromedriver

当我在chrome上运行我的selenium代码时出现以下错误,但它在firefox上运行正常。

org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: chrome=51.0.2704.84)
  (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Mac OS X 90.11.4 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 55.19 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: ‘mm-MacBook-Pro.local', ip: ’90.0.0.5’, os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.4', java.version: '1.7.0_60'
Session ID: 2618f9cc58558217216fee85102d9a15
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/var/folders/qg/dycb2gvn04g715_18wlclrrw0000gn/T/.org.chromium.Chromium.CWvi9E}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=51.0.2704.84, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]

2 个答案:

答案 0 :(得分:3)

你使用Docker运行吗?如果是这样,您可能需要增加共享内存大小,例如shm_size: 1g

答案 1 :(得分:0)

我遇到了同样的问题,这是由较大的背景图像引起的。将/dev/shm挂载到主机系统可以解决此问题。

Docker Compose

  chrome:
    image: selenium/node-chrome:3.14.0
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
    volumes:
      - /dev/shm:/dev/shm