如何在CloudFoundry上运行Selenium-Grid?

wil*_*oop 3 selenium-grid cloud-foundry selenium-grid2

有人用Gorouter提供的路由在CloudFoundry上运行Selenium-Grid吗?

根据“ Selenium-Grid文档”,我们可以将集线器地址传递给这样的节点实例:

java -jar selenium-server-standalone.jar \ 
  -role node \
  -hub http://myhub.cf/grid/register 
Run Code Online (Sandbox Code Playgroud)

但是此节点使用本地地址和端口注册自己。

wil*_*oop 5

我已经找到解决问题的方法(Selenium v​​3.14.0)。

本地测试基于 selenium-server-standalone

基于Docker的CloudFoundry清单

https://hub.docker.com/u/selenium/

---
applications:
- name: selenium-hub
  docker:
    image: selenium/hub
  instances: 1
  memory: 1G
  disk_quota: 1G
  routes:
  - route: selenium-hub.mycf.cloud
  env: 
    JAVA_OPTS: "-Xmx640M"
    GRID_DEBUG: false
    # Max "browser" sessions a grid can handle
    GRID_MAX_SESSION: 5
Run Code Online (Sandbox Code Playgroud)

节点数

---
applications:
- name: selenium-node-chrome-1
  docker:
    image: selenium/node-chrome
  instances: 1
  memory: 1G
  disk_quota: 1.5G
  routes:
  - route: selenium-node-chrome-1.mycf.cloud
  env: 
    JAVA_OPTS: "-Xmx640M"
    GRID_DEBUG: false
    HUB_HOST: selenium-hub.mycf.cloud
    HUB_PORT: 80
    NODE_PORT: 8080
    REMOTE_HOST: http://selenium-node-chrome-1.mycf.cloud:80
    # Max "browser" sessions a node can handle. Default determined by configuration type.
    NODE_MAX_SESSION: 5

- name: selenium-node-firefox-1
  docker:
    image: selenium/node-firefox
  instances: 1
  memory: 1G
  disk_quota: 1.5G
  routes:
  - route: selenium-node-firefox-1.mycf.cloud
  env: 
    JAVA_OPTS: "-Xmx640M"
    GRID_DEBUG: false
    HUB_HOST: selenium-hub.mycf.cloud
    HUB_PORT: 80
    NODE_PORT: 8080
    REMOTE_HOST: http://selenium-node-firefox-1.mycf.cloud:80
    # Max "browser" sessions a node can handle. Default determined by configuration type.
    NODE_MAX_SESSION: 5
Run Code Online (Sandbox Code Playgroud)