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

相关推荐
ClouGence4 天前
不搭 Selenium 或 Playwright,怎么测试公司的内网业务?
selenium·测试
测试界的小码农5 天前
【让 AI 生成的测试用例变成 pytest API 自动化脚本】
人工智能·测试用例·pytest
2601_9679873712 天前
Python在自动化测试中有哪些应用?
python自动化测试·selenium·appium·pytest·性能测试
EVE จุ๊บ15 天前
playwright和selenium的区别是什么
selenium·测试工具
Madison-No717 天前
pytest框架
pytest
P1Browser20 天前
Puppeteer 与 Selenium 技术对比:多账号自动化管理如何做环境隔离?
selenium·测试工具·自动化
凛铄linshuo23 天前
分析业务流程什么时候适合断言?
python·pytest
凛铄linshuo24 天前
自动化测试:pytest第一个实例学习
学习·pytest
Data_Journal24 天前
如何使用 Selenium 和 Node.js 绕过 CAPTCHA
selenium
郝学胜-神的一滴24 天前
Python浏览器自动化:Selenium与Playwright实战对比,网页爬虫&自动操作一站式指南
开发语言·爬虫·python·selenium·程序人生·自动化