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
相关推荐
星辰_mya15 分钟前
Kafka 的 KRaft 模式
分布式·kafka
期待のcode16 分钟前
docker将镜像推送到阿里云镜像仓库与私有镜像仓库
阿里云·docker·容器
only-qi1 小时前
RedLock:分布式锁的设计争议与实战踩坑
分布式
忙碌5441 小时前
Spring Boot应用Docker化部署全攻略:从入门到生产环境实践
spring boot·后端·docker
yangyanping201081 小时前
消息队列之消费者如何获取消息
分布式·架构·kafka
AlickLbc2 小时前
RabbitMQ安装记录
分布式·rabbitmq
切糕师学AI2 小时前
Apache ZooKeeper 简介
分布式·zookeeper·apache
Francek Chen3 小时前
【大数据存储与管理】分布式文件系统HDFS:05 HDFS存储原理
大数据·hadoop·分布式·hdfs
星辰_mya3 小时前
Kafka之Broker 磁盘写满 → 整个集群只读
分布式·kafka
星辰_mya3 小时前
Kafka Consumer Group Rebalance 频繁
分布式·kafka