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
相关推荐
m0_646429973 小时前
Docker 完整核心知识点总结(超通俗易懂版)
运维·docker·容器
此时不提桶,更待何时4 小时前
06-18-A-RabbitMQ消息特性与消费机制详解
分布式·rabbitmq
闻哥5 小时前
分布式任务调度框架:XXL-Job / ElasticJob / DolphinScheduler / SchedulerX 架构对比与选型
分布式·架构·wpf
明月无心照西山5 小时前
分布式任务系统的监控告警分级与自愈设计——以帮帮星球为例
分布式
guo_wen_qiang5 小时前
kafka一直restarting,报错InconsistentClusterIdException
分布式·kafka
实战派K8S&DB6 小时前
TDSQL 核心模块与进程体系
运维·数据库·分布式·sql·mysql
吴声子夜歌6 小时前
Docker入门与实战——实战案例(Web服务与应用)
docker·容器
han68896 小时前
selenium之实战
笔记·python·selenium·测试工具·自动化
仍然.6 小时前
Redis---分布式锁
数据库·redis·分布式
Wang's Blog6 小时前
Java 项目部署之 Docker工具快速入门: Docker 架构拆解:镜像、容器、守护进程与 Registry
java·docker·架构