使用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

相关推荐
橘颂TA17 小时前
【测试】自动化测试函数介绍——web 测试
python·功能测试·selenium·测试工具·dubbo
流㶡19 小时前
Python爬虫:POST与Selenium
爬虫·python·selenium
Warren9821 小时前
Pytest Fixture 作用域详解:Function、Class、Module、Session 怎么选
面试·职场和发展·单元测试·pytest·pip·模块测试·jira
0思必得01 天前
[Web自动化] Selenium处理动态网页
前端·爬虫·python·selenium·自动化
我的xiaodoujiao2 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 44--将自动化测试结果自动推送至钉钉工作群聊
前端·python·测试工具·ui·pytest
我的xiaodoujiao2 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 45--生成项目需要的requirements.txt依赖文件
python·学习·测试工具·pytest
月明长歌2 天前
全栈测试修炼指南:从接口策略到 Python+Pytest+Allure 企业级架构
python·架构·pytest
uyeonashi2 天前
Boost搜索引擎测试报告
功能测试·selenium·搜索引擎
@zulnger2 天前
selenium 自动化测试工具实战项目(订单)
selenium·测试工具·自动化
一晌小贪欢2 天前
Python 测试利器:使用 pytest 高效编写和管理单元测试
python·单元测试·pytest·python3·python测试