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
相关推荐
爱宇阳7 分钟前
从容器化到自动化:Vue3 项目 Docker 部署与 GitLab CI/CD 集成 Harbor 全流程
docker·自动化·gitlab
ejinxian4 小时前
Linux 虚拟化技术 KVM/ESXI/Docker
linux·运维·docker·qemu·openvz
新疆嘉博智选科技有限公司5 小时前
Macos系统上搭建Hadoop详细过程
大数据·hadoop·分布式
lxmyzzs5 小时前
vscode-ssh无法进入docker问题解决
vscode·docker·ssh
Candice_jy5 小时前
vscode运行ipynb文件:使用docker中的虚拟环境
服务器·ide·vscode·python·docker·容器·编辑器
roman_日积跬步-终至千里7 小时前
【Docker下部署高可用】StarRocks 存算一体架构高可用部署要点
docker·容器·架构
醉卧雕龙舫 、18 小时前
七.Docker网络
docker
JH307319 小时前
《Redis 经典应用场景(一):缓存、分布式锁与限流》
redis·分布式·缓存
小坏讲微服务19 小时前
五分钟使用 Docker-compose搭建 Redis 8.0 中间件
运维·redis·docker·中间件·容器·kubernetes·k8s
Aimyon_3619 小时前
MinerU Docker自定义版本部署
运维·docker·容器