# selenium_demo **Repository Path**: L7_simple/selenium_demo ## Basic Information - **Project Name**: selenium_demo - **Description**: web UI自动化测试demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-04 - **Last Updated**: 2022-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # selenium_demo #### 介绍 使用selenium写了个demo测试 #### 软件架构 - demo:各种小点的demo - qyex:企业微信测试demo - api:接口 - data:数据 - page:页面类集合 - testcase:测试用例 - selenium_grid:测试selenium_grid - common: 封装元素定位 - util: 工具类(报告、日志、读写yaml文件、自动下载匹配浏览器版本的driver并获取等) - conftest: fixture - run: 入口 #### 安装教程 1. 准备包 `pip install selenium` `pip install webdriver_manager` `pip install allure-pytest` `pip install pytest` `pip install pytest-assume` `pip install rerunfailures` 2. 准备selenium_grid 1. 下载selenium-server-standalone-3.141.59.jar 2. 下载node3 3. jar包和node3.json文件放在同一个文件夹 4. 启动hub、node(如果需要多个node,就执行多次启动命令) #### 使用说明 1. 使用selenium 1. 新建文件qyex/data/corp.yaml,存储corpid & corpsecret 2. 使用pytest运行test_*.py 2. 使用selenium_grid ``` # 启动 hub java -jar selenium-server-standalone-3.141.59.jar -role hub # 启动 node java -jar selenium-server-standalone-3.141.59.jar -role node -port 5677 # 配置文件方式启动node(推荐) java -jar selenium-server-standalone.jar -role node -nodeConfig node3.json ``` #### 相关文档 1. SeleniumGrid安装文档[SeleniumGrid2](https://www.selenium.dev/documentation/legacy/grid_2/)