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
相关推荐
AAA修煤气灶刘哥8 小时前
别让Redis「歪脖子」!一次搞定数据倾斜与请求倾斜的捉妖记
redis·分布式·后端
muyun280020 小时前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
Aomnitrix20 小时前
知识管理新范式——cpolar+Wiki.js打造企业级分布式知识库
开发语言·javascript·分布式
程序消消乐20 小时前
Kafka 入门指南:从 0 到 1 构建你的 Kafka 知识基础入门体系
分布式·kafka
智能化咨询20 小时前
Kafka架构:构建高吞吐量分布式消息系统的艺术——进阶优化与行业实践
分布式·架构·kafka
Chasing__Dreams20 小时前
kafka--基础知识点--5.2--最多一次、至少一次、精确一次
分布式·kafka
测试老哥1 天前
Selenium 使用指南
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
傻傻虎虎1 天前
【Docker】常用帮忙、镜像、容器、其他命令合集(2)
运维·docker·容器
在未来等你1 天前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试