使用pytest-selenium插件,ui自动化示例

插件:pytest-selenium

可通过pip命令在终端安装插件,pytest-selenium插件创建了浏览器实例,可以直接使用浏览器实例

测试网站:百度

浏览器:谷歌

目的:使用pytest-selenium插件,在输入框输入查询信息后,保存查询结果到html文件

pytest --driver Chrome --driver-path=./chromedriver.exe test_baidu.py -v -s

谷歌浏览器及对应驱动器下载链接: https://pan.baidu.com/s/10s3DnX3s9GzUxCi0hDih2w?pwd=3ifp 提取码: 3ifp

相关推荐
测试工程师成长之路1 天前
Serenity BDD 框架:Java + Selenium 全面指南(2026 最新)
java·开发语言·selenium
may_一一1 天前
xpath定位:selenium和playwrightAnt Design / 表单类页面)
selenium·测试工具
姚青&1 天前
Pytest 测试用例编写
测试用例·pytest
Warren981 天前
Pytest Fixture 作用域与接口测试 Token 污染问题实战解析
功能测试·面试·单元测试·集成测试·pytest·postman·模块测试
0思必得02 天前
[Web自动化] Selenium设置相关执行文件路径
前端·爬虫·python·selenium·自动化
程序员小远2 天前
UI自动化测试用例管理平台搭建
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
0思必得02 天前
[Web自动化] Selenium处理Cookie
前端·爬虫·python·selenium·自动化
serve the people2 天前
python环境搭建 (七) pytest、pytest-asyncio、pytest-cov 试生态的核心组合
开发语言·python·pytest
不会代码的小测试2 天前
UI自动化-Grid分布式运行
运维·分布式·python·selenium·自动化
0思必得03 天前
[Web自动化] Selenium处理iframe和frame
前端·爬虫·python·selenium·自动化·web自动化