cloud-foundry - 如何在 CloudFoundry 上运行 Selenium-Grid?
问题描述
有没有人使用 Gorouter 提供的路由在 CloudFoundry 上运行 Selenium-Grid?
根据“Selenium-Grid Documentation”,我们可以将集线器地址传递给这样的节点实例:
java -jar selenium-server-standalone.jar \
-role node \
-hub http://myhub.cf/grid/register
但是这个节点使用本地地址和端口注册自己。
解决方案
我已经找到了解决问题的方法(Selenium v3.14.0)。
基于本地测试selenium-server-standalone
中心
java -Xmx640M -jar selenium-server-standalone.jar -role hub -debug
节点
java -Xmx640M -jar selenium-server-standalone.jar -role node -debug \ -hub http://localhost:4444/grid/register \ -port 8080 -remoteHost http://localhost:8080
基于 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
节点
---
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
推荐阅读
- mysql - 更改特定表中数据的过程存在问题
- css - 使用 React 样式的组件设置自定义光标图像
- css - Mpdf - 页面选择器或 css 到自动添加页面中的特定页面
- java - Android WebRTC DataChannel 始终为空且不发送 ICE 候选
- powerbi - 我们可以使用 DAX 在 Power BI 中进行条件格式化吗?
- python - ModuleNotFoundError:运行 docker 映像时没有名为“turbodbc”的模块
- flutter - Flutter video_player如何处理临时数据
- python - 从 CSV 读取并分配给变量
- laravel - Laravel 更改作业连接到不同的数据库
- ios - 如何快速将数据传递到下一个视图控制器?