如何在CloudFoundry上运行Selenium-Grid? [英] How to run Selenium-Grid on CloudFoundry?

查看:124
本文介绍了如何在CloudFoundry上运行Selenium-Grid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

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

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

  • 集线器

  • 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 
    

  • 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
    

    节点

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

    这篇关于如何在CloudFoundry上运行Selenium-Grid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆