七秒鱼记忆~
每天进步一点点!!!
随笔 - 55,  文章 - 2,  评论 - 0,  阅读 - 7825
06 2021 档案
接口自动化-->文件下载
摘要:url ='XXX' cookies ={"id":"123456"} res =requests.get(url,cookies=cookies) if res.status_code == 200: #写入文件 with open('F:\\script\\download\\test_05.z 阅读全文
posted @ 2021-06-28 17:56 fishing~ 阅读(92) 评论(0) 推荐(0) 编辑
接口自动化-->文件上传
摘要:接口请求: import requests #上传接口的参数 files = {"projectFile": ('sub_process.json', open("F:\\上传文件\\task_01.json", 'rb'), "application/json")} #参数说明: #project 阅读全文
posted @ 2021-06-28 17:20 fishing~ 阅读(317) 评论(0) 推荐(0) 编辑
selenium-->键盘操作
摘要:import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from 阅读全文
posted @ 2021-06-28 14:25 fishing~ 阅读(31) 评论(0) 推荐(0) 编辑
selenium-->鼠标操作
摘要:import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from 阅读全文
posted @ 2021-06-28 14:24 fishing~ 阅读(34) 评论(0) 推荐(0) 编辑
接口自动化-->数据库操作
摘要:#mysql操作 #安装pymysql,pip install pymysql from pymysql.cursors import DictCursor import pymysql #1、建立连接 con =pymysql.connect(host='地址', user='用户名', pass 阅读全文
posted @ 2021-06-03 09:58 fishing~ 阅读(15) 评论(0) 推荐(0) 编辑
json和字典之间的转换
摘要:import json #json字符串转换字典 data ='{"a":1,"b":2,"c":null}' data_dict =json.loads(data) # print(data_dict) #{'a': 1, 'b': 2, 'c': None} #字典转换json字符串 dict_ 阅读全文
posted @ 2021-06-01 16:45 fishing~ 阅读(93) 评论(0) 推荐(0) 编辑
接口自动化-->配置文件
摘要:#配置文件 #1、python文件 # class ConfigFile: # name ="hhh" # age ="18" # print(ConfigFile.name) #2、yaml文件 #1、创建yaml格式文件 #2、安装yaml,pip pyyaml #3、导入 import yam 阅读全文
posted @ 2021-06-01 11:03 fishing~ 阅读(8) 评论(0) 推荐(0) 编辑
接口自动化-->日志处理
摘要:import logging #日志级别: """ 1、debug:调试信息 2、info:主体功能信息,流水 3、warning:警告 4、error:错误 5、critical:严重的,致命的 """ #级别定义 logging.error("这是一条错误信息") #日志收集器: #1、日志收集 阅读全文
posted @ 2021-06-01 11:01 fishing~ 阅读(16) 评论(0) 推荐(0) 编辑
接口自动化-->前后置条件&ddt
摘要:import os import ddt import unittest from test.test_api.excel_handler import ExcelHandler @ddt.ddt class TestCls(unittest.TestCase): dir_name = os.pat 阅读全文
posted @ 2021-06-01 11:00 fishing~ 阅读(16) 评论(0) 推荐(0) 编辑
接口自动化-->excel操作
摘要:import os import openpyxl data_path =os.path.dirname(os.path.abspath(__file__)) file_path =os.path.join(data_path,'data.xlsx') #工具:openpyxl、tablib、pan 阅读全文
posted @ 2021-06-01 10:57 fishing~ 阅读(17) 评论(0) 推荐(0) 编辑


< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示