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
相关推荐
江湖有缘几秒前
Docker环境下使用RustScan端口扫描工具教程
运维·docker·容器
70asunflower6 分钟前
镜像仓库(Image Registries)详解
linux·docker·容器
岁岁种桃花儿11 分钟前
深度解析DolphinScheduler核心架构:搭建高可用Zookeeper集群
linux·分布式·zookeeper
青树寒鸦14 分钟前
wsl的docker备份redis和迁移
redis·docker·容器
岩屿16 分钟前
Ubuntu下安装Docker并部署.NET API(二)
运维·docker·容器·.net
yxy___31 分钟前
达梦分布式集群DPC_影子和实体副本相互转换(DEM)_yxy
分布式·dem·影子副本
努力有什么不好34 分钟前
Hadoop3.2.2伪分布式搭建
大数据·hadoop·分布式
hopsky1 小时前
限制 Docker Desktop 的资源使用
运维·docker·容器
春日见1 小时前
docker崩溃,闪退,与vscode断开连接
vscode·docker·容器
Suchadar1 小时前
Docker搭建Web测试靶场
运维·docker·容器