上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 143 下一页
摘要: # 前言 最近在运行pytest的时候,经常出现这个警告DeprecationWarning: pkg_resources is deprecated as an API See https://setuptools.pypa.io/en/latest/pkg_resources.html from 阅读全文
posted @ 2023-09-09 09:05 上海-悠悠 阅读(4500) 评论(2) 推荐(1) 编辑
摘要: 前言 pydantic 可以使用 EmailStr 校验邮箱格式 环境准备 EmailStr 需按依赖包ImportError: email-validator is not installed, run pip install pydantic[email] pip install pydanti 阅读全文
posted @ 2023-09-07 11:42 上海-悠悠 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 前言 v1.4.5 新增功能。同一层级variables 变量中,可以引用前面的变量了 config 中 variables 可以引用同一层级变量 用例中 variables 可以引用同一层级变量 (备注:从v1.2.4 以后新版本不再公开,新功能内部 VIP 学员可以使用,公开版本仅解决bug, 阅读全文
posted @ 2023-08-29 19:54 上海-悠悠 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 前言 --full-page-screenshot参数是pytest-playwright在使用,在失败时是否进行完整页面截图。默认情况下,仅捕获视口。 需开启 --screenshot 开关 (默认: off). 用例失败截图 环境准备: 1.安装playwright最新v1.37版本 2.安装p 阅读全文
posted @ 2023-08-29 08:20 上海-悠悠 阅读(435) 评论(0) 推荐(1) 编辑
摘要: 前言 playwright 默认全局的导航时间是30秒,查找元素超时也是30秒, 有以下几个方法设置全局超时时间: browser_context.set_default_navigation_timeout() browser_context.set_default_timeout() page. 阅读全文
posted @ 2023-08-28 21:46 上海-悠悠 阅读(1352) 评论(0) 推荐(0) 编辑
摘要: 前言 playwright 操作浏览器上的页面后,后续如果想结合其他的框架操作接口(如:requests),可以直接获取到浏览器的 cookies。 context.cookies() 获取浏览器 cookies 使用示例 from playwright.sync_api import sync_p 阅读全文
posted @ 2023-08-28 16:23 上海-悠悠 阅读(833) 评论(0) 推荐(0) 编辑
摘要: 前言 每个Playwright浏览器上下文都有与其关联的APIRequestContext实例,该实例与浏览器上下文共享cookie存储,可以通过browser_context.request或page.request访问。也可以通过调用api_request.new_context()手动创建一个 阅读全文
posted @ 2023-08-28 13:09 上海-悠悠 阅读(1076) 评论(0) 推荐(0) 编辑
摘要: 前言 playwright 设置 ignore_https_errors 参数忽略 SSL 错误 context 上下文中设置 browser.new_context() 创建上下文时 from playwright.sync_api import sync_playwright, expect # 阅读全文
posted @ 2023-08-27 15:38 上海-悠悠 阅读(492) 评论(0) 推荐(0) 编辑
摘要: # 前言 .pywinauto 可以使用 `print_control_identifiers()` 方法打印控件菜单树结构,这对我们查找控件非常方便。 # print_control_identifiers() 查看相关源码 ```python def print_control_identifi 阅读全文
posted @ 2023-08-26 14:56 上海-悠悠 阅读(442) 评论(1) 推荐(0) 编辑
摘要: # 前言 pywinauto 查找窗口和控件时会有超时时间与轮询机制,可以通过timings 模块设置全局等待时间。 # timings 模块 timings 模块有三个模式可以设置 - timings.Timings.fast() 快速模式 - timings.Timings.defaults() 阅读全文
posted @ 2023-08-26 08:17 上海-悠悠 阅读(265) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 143 下一页