Maliaotw
8/21/2018 - 7:54 PM

docker_selenium2_VNC

docker_selenium2_VNC

hub:
  image: selenium/hub:2.53.1-beryllium
  ports:
    - "4446:4444"
  environment:
    - GRID_MAX_SESSION=5
  restart: always

firefox:
  image: selenium/node-firefox-debug:2.53.1-beryllium
  environment:
    - FIREFOX_VERSION=45.8.0
    - NODE_MAX_INSTANCES=10
    - NODE_MAX_SESSION=10
  ports:
    - "5921:5900"
  links:
    - hub
  restart: always

chrome:
  image: selenium/node-chrome-debug:2.53.1-beryllium
  environment:
    - NODE_MAX_INSTANCES=10
    - NODE_MAX_SESSION=10
  ports:
    - "5922:5900"
  links:
    - hub
  restart: always

說明

自帶selenium的docker容器,並可透過vnc查看測試內容。

版本 selenium2

  • FIREFOX: 45.8.0 vnc port : 5921

  • chrome: 2.53.1 vnc port : 5922

操作

  1. dowmload docker-compose.yml
curl https://gist.githubusercontent.com/Maliaotw/559bc0293a9e0a25c17ffc415e9705af/raw/2c660652f5ebce76765adfad1b7d5f61b17e02cd/docker-compose.yml -o docker-compose.yml
  1. run
docker-compose up -d