摘要: 1. 在当前测试计划点击-配置元件-HTTP请求默认值 2. 点击高级-设置proxy相关信息 同时可以在基本信息里可以设置当前测试计划所有接口访问的http协议和域名,端口等信息 阅读全文
posted @ 2020-05-28 10:37 hchan 阅读(1288) 评论(0) 推荐(1)
摘要: 在测试用例所在目录的conftest文件中添加钩子函数pytest_collection_modifyitems(items)即可 def pytest_collection_modifyitems(items): """ 测试用例收集完成时,将收集到的item的name和nodeid的中文显示在控 阅读全文
posted @ 2020-05-27 16:56 hchan 阅读(696) 评论(0) 推荐(0)
摘要: 在通过requests.post()进行POST请求时,传入报文的参数有两个,一个是data,一个是json。 data与json既可以是str类型,也可以是dict类型。 区别: 1、不管json是str还是dict,如果不指定headers中的content-type,默认为applicatio 阅读全文
posted @ 2020-05-26 10:51 hchan 阅读(1226) 评论(0) 推荐(0)
摘要: def shuchu(num): for i in range(num): for j in range(i + 1): print(j + 1, end="") print("") shuchu(8) 阅读全文
posted @ 2020-05-21 17:01 hchan 阅读(999) 评论(0) 推荐(0)
摘要: def quick_sort(list_a: list) -> list: if len(list_a) > 0: first = list_a[0] left = quick_sort([l for l in list_a[1:] if l < first]) right = quick_sort 阅读全文
posted @ 2020-05-21 16:53 hchan 阅读(1051) 评论(0) 推荐(0)
摘要: def sum(num: int) -> int: res = 0 while num != 0: res += num % 10 num //= 10 return res print(sum(789)) 阅读全文
posted @ 2020-05-21 16:48 hchan 阅读(351) 评论(0) 推荐(0)
摘要: def cheng(a: int, b: int) -> int(): min_num = min(a, b) max_num = max(a, b) res = 0 for i in range(0, min_num): res += max_num return res print(cheng( 阅读全文
posted @ 2020-05-21 16:45 hchan 阅读(421) 评论(0) 推荐(0)
摘要: (一) 方法 方法 简单说明 execute_async_script(script, args) 异步执行JS代码 script:被执行的JS代码 args:js代码中的任意参数 execute_script(script, args) 同步执行JS代码 script:被执行的JS代码 args: 阅读全文
posted @ 2020-05-21 16:40 hchan 阅读(432) 评论(0) 推荐(1)
摘要: 作者:爱码小士链接:https://www.zhihu.com/question/58155715/answer/1201860611来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 1.如何把自动化测试在公司中实施并推广起来的? 1.项目组调研选择自动化工具并开会演示 阅读全文
posted @ 2020-05-21 16:27 hchan 阅读(459) 评论(0) 推荐(0)
摘要: conftest.py 里添加截图的逻辑 # coding:utf-8 import os from selenium import webdriver import pytest from common.settings import PROXY_SERVER driver = None @pyt 阅读全文
posted @ 2020-05-21 16:22 hchan 阅读(708) 评论(0) 推荐(0)