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
相关推荐
阿里巴巴P8资深技术专家1 小时前
docker容器启动报错
运维·docker·容器
ZePingPingZe3 小时前
浅谈接口幂等性、MQ消费幂等性
分布式·java-rocketmq
Wang's Blog3 小时前
RabbitMQ: 高并发外卖系统的微服务架构设计与工程实现
分布式·微服务·rabbitmq
元气满满-樱5 小时前
docker网络模式详解
网络·docker·容器
空中楼阁,梦幻泡影5 小时前
Docker安装MinIO
运维·docker·容器·minio·存储
墨香幽梦客7 小时前
合规视角的数据安全与隐私:HIPAA等法规的架构内生化实践
java·分布式·微服务
znhy60587 小时前
分布计算系统
网络·分布式
Selegant7 小时前
Docker 搭建 MySQL 主从服务实战操作详解
mysql·docker·容器
狮恒7 小时前
OpenHarmony Flutter 分布式设备发现与连接:无感组网与设备协同管理方案
分布式·flutter·wpf·openharmony
Wang's Blog9 小时前
RabbitMQ: 消息交换机制的核心原理与实践指南之基于 AMQP 协议的系统设计与工程实现
分布式·rabbitmq