首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Selenium Docker:试图打开fancybox弹出窗口时Firefox崩溃

Selenium Docker:试图打开fancybox弹出窗口时Firefox崩溃
EN

Stack Overflow用户
提问于 2018-07-31 13:39:12
回答 1查看 1.2K关注 0票数 3

我正在使用Selenium docker-compose with specs:

代码语言:javascript
复制
ubuntu instance: 16.04
firefox browser version is 61.0
selenium version is 3.13.0
geckodriver version is 0.21.0.

我的docker-compose.yml文件如下所示:

代码语言:javascript
复制
version: "3"
services:
  selenium-hub:
    image: selenium/hub
    container_name: selenium-hub
    ports:
      - "4444:4444"
  chrome:
    image: selenium/node-chrome
    depends_on:
      - selenium-hub
    environment:
      - HUB_PORT_4444_TCP_ADDR=selenium-hub
      - HUB_PORT_4444_TCP_PORT=4444
  firefox:
    image: selenium/node-firefox
    depends_on:
      - selenium-hub
    environment:
      - HUB_PORT_4444_TCP_ADDR=selenium-hub
      - HUB_PORT_4444_TCP_PORT=4444

我正在运行一个带有按钮的测试,单击该按钮将打开一个弹出窗口。它不是警报或另一个窗口。问题是,当我试图点击那个按钮时,浏览器似乎崩溃了。但有以下例外:

代码语言:javascript
复制
(/opt/firefox-latest/firefox:142): dconf-CRITICAL **: unable to create directory '/home/seluser/.cache/dconf': Permission denied.  dconf will not work properly.

[Parent 72, Gecko_IOThread] WARNING: pipe error (52): Connection reset by peer: file /builds/worker/workspace/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353

###!!! [Parent][MessageChannel] Error: (msgtype=0x16007F,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv

A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping

详细信息:

我试图通过selenium-docker访问的应用程序的HTML结构是:

代码语言:javascript
复制
 <a id=some_id href="javascript:void(0);" onclick="openPopup(true)" class="fancybox">
       <img src=some_src.svg class=some_class title>
</a>

我已经使用xpath、class、css选择器访问了元素。我找不到问题的根本原因。这是与浏览器相关的,还是与docker相关的,还是与驱动相关的?

更新:我的IDE上的堆栈跟踪是:

代码语言:javascript
复制
org.openqa.selenium.SessionNotCreatedException: Tried to run command without establishing a connection
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: 'SOME_HOST', ip: 'SOME_IP', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 61.0.1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 255, moz:profile: /tmp/rust_mozprofile.IYBVxi..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 4.4.0-1061-aws, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, webdriver.remote.sessionid: 51c21208-100f-4a04-947c-3f9...}
Session ID: 51c21208-100f-4a04-947c-3f99316b75e7
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
    at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:448)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)  
EN

回答 1

Stack Overflow用户

发布于 2018-07-31 16:11:04

已找到解决问题的方法。

我正在努力寻找一个明确的原因,但就目前而言,自动化工作正常。我在docker-compose.yml中添加的一些东西修复了以下问题:在selenium-hub中添加:

代码语言:javascript
复制
environment:
      - GRID_BROWSER_TIMEOUT=30

在firefox中添加:

代码语言:javascript
复制
volumes:
      - "/dev/shm:/dev/shm"

虽然它的工作,我仍然会寻找一个合乎逻辑的解释,如果有人有它,如果你张贴在这里,将非常感谢。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51606091

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档