How to run Selenium-Grid on CloudFoundry?

懵懂的女人 提交于 2019-12-12 13:24:13

问题


Did anyone run Selenium-Grid on CloudFoundry with routing provided by Gorouter?

According to the "Selenium-Grid Documentation" we can pass the hub address to a node instance like that:

java -jar selenium-server-standalone.jar \ 
  -role node \
  -hub http://myhub.cf/grid/register 

but this node registers yourself with the local address and port.


回答1:


I have already found a solution to my problem (Selenium v3.14.0).

Local test based on selenium-server-standalone

  • Hub

    java -Xmx640M -jar selenium-server-standalone.jar -role hub -debug
    
  • Node

    java -Xmx640M -jar selenium-server-standalone.jar -role node -debug \
      -hub http://localhost:4444/grid/register \
      -port 8080 -remoteHost http://localhost:8080 
    

CloudFoundry manifests based on docker

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

Hub

---
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

Nodes

---
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


来源:https://stackoverflow.com/questions/52624073/how-to-run-selenium-grid-on-cloudfoundry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!