seleniumbase web自动化测试

SeleniumBase是一个结合Selenium和unittest的测试框架,提供安装不同浏览器驱动、缓慢执行、元素高亮和错误暂停等特性。还支持通过pytest-thml插件生成测试报告。文中包含代码演示。
摘要由CSDN通过智能技术生成

20201009·selenium学习笔记

seleniumbase

一个基于Selenium和unittest单元测试框架的一个测试框架SeleniumBase,一些功能和API在探索中

1.安装

pip3 install seleniumbase
  1. 安装不同浏览器驱动
seleniumbase install chromedriver
seleniumbase install geckodriver
seleniumbase install edgedriver
seleniumbase install iedriver
seleniumbase install operadriver
  1. 缓慢执行,元素高亮
pytest my_first_test.py --demo_mode
  1. 错误暂停脚本
pytest my_first_test.py --pdb -s

“c”:继续
“s”:步骤
“n”: 下一步
  1. 利用pytest 的 pytest-thml插件生成测试报告
pytest test_suite.py --html=report.html
  1. 代码demo
from seleniumbase import BaseCase


class MyTestClass(BaseCase):

    def test_basic(self):#必须以test开头
        # 打开网页,参数1:url,默认为chrome浏览器
       
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值