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
相关推荐
谢亮_vipxieliang6 小时前
Spring Cloud 服务治理入门:注册发现、配置中心、网关限流、熔断降级与分布式一致性方案
分布式·spring·spring cloud
梦想不只是梦与想6 小时前
docker-compose.yml
docker·docker-compose·docker run
樱花落木兰14 小时前
分布式登录实战:Session 会话共享改造,Redis 存储用户登录状态
java·javascript·数据库·redis·分布式·缓存
ShineWinsu15 小时前
对于Redis:Steam、Geospatial、Hyperloglog、Bitmap、Bitfield类型的解析
数据库·c++·redis·分布式·缓存·面试·zset
更深兼春远15 小时前
第2篇:Dify 部署保姆级教程:用 Docker跑起来
docker·容器·dify
小白的码BUG之路19 小时前
Docker -- No space left on device
运维·docker·容器
程序员老陆20 小时前
Docker 命令全景指南:从镜像构建到生产运维
运维·docker·容器
Flynt1 天前
Redis Cluster主节点挂了,为什么"高可用"还全员掉线?我把三次kill的记录翻出来了
数据库·redis·分布式
灯澜忆梦1 天前
【minio】#1 | 简介与安装
docker·对象存储·minio
JosieBook1 天前
【数据库】MySQL 实战精通系列 · 第10篇:分库分表与分布式事务实战
数据库·分布式·mysql