2021年11月24日
摘要: 使用clickhouse_driver 的Client方法、和connect方法一直无法连接上clickhouse,但是对应的地址和连接信息在dbeaver中可以连接上 因为clickhouse的连接分为了tcp和http,对应的端口不一样 而公司中使用的是k8s,需要在services中查看cli 阅读全文
posted @ 2021-11-24 18:52 木木-林 阅读(1767) 评论(0) 推荐(1) 编辑
摘要: 下载第三方模块 pip install python-dateutil def time_diff(t1,t2): t1 = parse(t1) t2 = parse(t2) ts = (t2-t1).total_seconds() int_ts = int(ts/60) return int_ts 阅读全文
posted @ 2021-11-24 08:22 木木-林 阅读(137) 评论(0) 推荐(0) 编辑
  2021年11月21日
摘要: https://playwright.dev/python/docs/api/class-mouse/#mouse-click 下述方法都可以使用page进行调用 mouse.click(x, y, **kwargs) 鼠标点击 mouse.dblclick(x, y, **kwargs) 鼠标双击 阅读全文
posted @ 2021-11-21 22:55 木木-林 阅读(4638) 评论(0) 推荐(0) 编辑
摘要: https://playwright.dev/python/docs/test-runners 下载插件 pip install pytest-playwright 使用page fixture来编写一个测试用例 context.new_page()相当于前置操作 yield page为后置操作 书 阅读全文
posted @ 2021-11-21 22:48 木木-林 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: https://playwright.dev/python/docs/pom playwright 页面对象模型 优点: 1、页面元素与测试用例分离,便于维护和管理 2、页面操作按照页面封装,减少重复性工作,利于复用 阅读全文
posted @ 2021-11-21 17:16 木木-林 阅读(398) 评论(0) 推荐(0) 编辑
  2021年11月18日
摘要: element_handle.is_checked() # 元素是否被选择,一般用于校验单元框或复选框的状态 element_handle.is_disabled() #元素是否被禁用 element_handle.is_editable() #元素是否可编辑 element_handle.is_e 阅读全文
posted @ 2021-11-18 08:36 木木-林 阅读(1321) 评论(0) 推荐(0) 编辑
  2021年11月17日
摘要: 1、输入文字(fill) 适用于:<input>,<textarea>或[contenteditable],其他类型的会报错,page、element、frame都可以使用fill方法 from playwright.sync_api import sync_playwright with sync 阅读全文
posted @ 2021-11-17 23:41 木木-林 阅读(2541) 评论(0) 推荐(0) 编辑
  2021年11月16日
摘要: playwright 支持chromium, firefox, webkit,打开浏览器 with sync_playwright() as p: browser = p.chromium.launch(headless=False) #打开浏览器 browser.close()#关闭浏览器 pla 阅读全文
posted @ 2021-11-16 00:21 木木-林 阅读(6064) 评论(0) 推荐(0) 编辑
  2021年11月15日
摘要: 为什么要使用虚拟环境? 在多个项目中,要使用的模块版本可能不一样,使用虚拟环境可以使两个项目之间不受影响 例如之前公司使用的是httprunner2的版本,最近在学习httprunner3,那么就可以使用虚拟环境解决兼容两个httprunner版本的问题 1、cmd中执行命令 python -m v 阅读全文
posted @ 2021-11-15 09:52 木木-林 阅读(83) 评论(0) 推荐(0) 编辑
  2021年11月12日
摘要: from playwright.sync_api import sync_playwright import time import os # print(dirpath) with sync_playwright() as p: for i in [p.chromium, p.firefox]: 阅读全文
posted @ 2021-11-12 00:00 木木-林 阅读(3492) 评论(0) 推荐(0) 编辑