selenium部署分布式 UI 自动化测试环境-Docker

一、根据selenium/hub官网的配置信息,进行配置。

复制代码
How to run this image
The Hub and Nodes will be created in the same network and they will recognize each other by their container name. A Docker network⁠ needs to be created as a first step.

Create a Docker Network
docker network create grid
Start the Hub using the created network
docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:latest
Start the Node using the created network
docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \
    --shm-size="2g" \
    -e SE_EVENT_BUS_PUBLISH_PORT=4442 \
    -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \
    selenium/node-chrome:latest
If you are using Windows Powershell, use this command:

docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub `
    --shm-size="2g" `
    -e SE_EVENT_BUS_PUBLISH_PORT=4442 `
    -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 `
    selenium/node-chrome:latest
Point your WebDriver tests to http://localhost:4444⁠

在运行生成容器 selenium/node-chrome时,这里可以增加一些浏览器数量和关在数据卷目录的参数:

复制代码
-e SE_NODE_MAX_SESSIONS=2 
-e SE_NODE_OVERRIDE_MAX_SESSIONS=true
-v /Users/jd/selenium2node/dev/shm:/dev/shm
相关推荐
tryCbest1 天前
Linux使用Docker部署项目后期更新
linux·运维·docker
大数据001 天前
CLICKHOUSE分布式表初体验
分布式·clickhouse
失散131 天前
分布式专题——43 ElasticSearch概述
java·分布式·elasticsearch·架构
爬山算法1 天前
Redis(66)Redis如何实现分布式锁?
数据库·redis·分布式
缘的猿1 天前
Docker 与 K8s 网络模型全解析
docker·容器·kubernetes
运维栈记1 天前
使用Grafana监控K8S中的异常Pod
docker·kubernetes·grafana
W.Buffer1 天前
Kafka零拷贝原理深度解析:从传统拷贝痛点到工作实践优化
分布式·kafka
没有bug.的程序员1 天前
服务治理与 API 网关:微服务流量管理的艺术
java·分布式·微服务·架构·wpf
心态特好1 天前
解锁分布式唯一 ID:技术、实践与最佳方案
分布式·生活
东城绝神1 天前
《Linux运维总结:基于X86_64+ARM64架构CPU使用docker-compose一键离线部署consul 1.21.5容器版集群》
linux·运维·docker·架构·consul