selenium在Linux环境下截屏(save_screenshot)中文乱码的问题

在Linux环境下会browser.save_screenshot方法保存的图片中中文乱码,不便于排查问题,解决办法如下:

1、设置浏览器options选项

复制代码
options.add_argument("--lang=zh-CN")  # 设置语言为中文

2、安装中文字体

apt-get update

apt-get install -y fonts-wqy-zenhei fonts-wqy-microhei

3、安装字体渲染引擎

apt-get install -y fontconfig

相关推荐
Run Freely9378 小时前
接口测试-postman-全局变量与环境变量
测试工具·postman
我的xiaodoujiao11 小时前
从 0 到 1 搭建 Python 语言 Web UI自动化测试学习系列 8--基础知识 4--常用函数 2
前端·python·测试工具·ui
程序员小远14 小时前
常用的测试用例
自动化测试·软件测试·python·功能测试·测试工具·职场和发展·测试用例
(时光煮雨)15 小时前
【Python进阶】Python爬虫-Selenium
爬虫·python·selenium
依旧很淡定3 天前
Selenium(Python)创建Chrome浏览器实例
chrome·python·selenium
小熊出擊3 天前
【pytest】finalizer 执行顺序:FILO 原则
python·测试工具·单元测试·pytest
云闲不收3 天前
接口请求工具对比 apifox apipost swagger postman等
测试工具·postman
sitellla3 天前
Testify Go测试工具包入门教程
git·测试工具·其他·golang
我的xiaodoujiao3 天前
从 0 到 1 搭建 Python 语言 Web UI自动化测试学习系列 9--基础知识 5--常用函数 3
前端·python·测试工具·ui
可可南木4 天前
ICT 数字测试原理 8 - -VCL 的测试参数
开发语言·功能测试·测试工具·pcb工艺