python 网页自动化测试仪器_Python Selenium allure界面自动化测试

1、安装Selenium

cd到python安装路径的lib目录下,

pip install selenium

2、安装浏览器驱动:

Chrome:

https://sites.google.com/a/chromium.org/chromedriver/downloads

如果网络不行,可以到我的网盘中下载,我收集了一些,希望有用。

https://pan.baidu.com/s/1UP33MbEBM_4p1BdXTVHZqw

https://pan.baidu.com/disk/home#/all?path=%2F%E6%88%91%E7%9A%84%E8%B5%84%E6%BA%90&vmode=list

Firefox:

https://github.com/mozilla/geckodriver/releases

Edge:

https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver

Safari:

https://webkit.org/blog/6900/webdriver-support-in-safari-10

http://chromedriver.storage.googleapis.com/index.html下载对应版本的chromdriver:

使用不同的浏览器,需要下载对应驱动,并且确保驱动文件如chromedriver.exe放到你的系统环境PATH中

3、安装Pytest

cd到python安装路径的lib目录下,

pip3 install -U pytest

4、安装allure:

pip install pytest-allure-adaptor

cd 到test_login.py所在目录,执行以下命令:

pytest test_login.py --alluredir=./result/

如果报错,执行以下操作:

pip uninstall pytest-allure-adaptor

pip install allure-pytest

5、安装allure-commandline

--先安装jdk8,https://pan.baidu.com/disk/home#/all?path=%2F%E6%88%91%E7%9A%84%E8%B5%84%E6%BA%90&vmode=list

--下载allure命令行工具,

https://github.com/allure-framework/allure2

https://pan.baidu.com/s/1LoPJQM27PfGwXWZ--bs8XQ

https://pan.baidu.com/disk/home#/all?path=%2F%E6%88%91%E7%9A%84%E8%B5%84%E6%BA%90&vmode=list

--进入bin目录,运行allure.bat

--添加allure到环境变量PATH

6、生成html测试报告:

cd到python的allure目录下执行以下操作

allure generate [reusult的路径] -o ./report/ --clean

allure open -h 127.0.0.1 -p 8083 ./report/

运行后本机的浏览器将打开 http://127.0.0.1:8083/index.html 网页,展示测试报告

Jenkins和allure报告集成:

https://blog.csdn.net/liuchunming033/article/details/79624474

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值