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
相关推荐
么么...6 分钟前
在 Ubuntu 上安装 Docker 并部署 MySQL 容器
linux·运维·经验分享·笔记·mysql·ubuntu·docker
学Linux的语莫29 分钟前
kompose、docker转k8s
docker·容器·kubernetes
AI视觉网奇1 小时前
nvcr.io 登录方法
docker·ue5
Wang's Blog2 小时前
Kafka: 分布式配置管理的核心挑战
分布式·kafka
回家路上绕了弯2 小时前
分布式事务TCC详解:高并发场景下的柔性事务最优解?
分布式·后端
是阿威啊3 小时前
【第一站】本地虚拟机部署Hadoop分布式集群
大数据·linux·hadoop·分布式
weixin_445476683 小时前
Docker 在 Ubuntu(国内网络)安装及问题解决总结
网络·ubuntu·docker
一点晖光5 小时前
docker配置npm环境变量出现问题
docker·容器·npm
一分半心动5 小时前
windows docker desktop 安装VibeVoice
运维·docker·容器
川215 小时前
ZooKeeper配置+失误
linux·分布式·zookeeper