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
相关推荐
旷世奇才李先生1 小时前
Docker实战:容器化部署与Docker Compose集群管理(附企业级案例)
spring cloud·docker·eureka
曾阿伦1 小时前
Spark flatMapToPair算子卡顿优化
大数据·分布式·spark
卷毛的技术笔记2 小时前
从“拆东墙补西墙”到“最终一致”:分布式事务在Spring Boot/Cloud中的破局之道
java·spring boot·分布式·后端·spring cloud·面试·rocketmq
大G的笔记本4 小时前
redis分布式锁过期问题和自动续期和主从延迟问题
redis·分布式
Sirius Wu4 小时前
Docker 镜像的构建、打包、变更、再次打包全流程
运维·docker·容器
Zhu7585 小时前
【软件部署】docker环境部署domino
运维·docker·容器
隔壁寝室老吴6 小时前
使用Flink2.0消费低版本的Kafka
分布式·kafka
Chasing__Dreams8 小时前
Mysql--基础知识点--105--分布式事务
数据库·分布式·mysql
java干货8 小时前
Redis 分布式限流的四大算法与终极形态
数据库·redis·分布式
富士康质检员张全蛋8 小时前
Kafka架构 主题中的分区
分布式·kafka