自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(114)
  • 收藏
  • 关注

原创 websocket协议与http协议区别对比

 WebSocket和HTTP的区别http协议轮询:三、Long poll 和Ajax轮询以及WebSocket的原理1、Ajax轮询的原理。场景如下:客户端:啦啦啦,有没有新信息(Request)服务端:没有(Response)客户端:啦啦啦,有没有新信息(Request)服务端:没有。。(Response)客户端:啦啦啦,有没有新信息(Request)服务端:你...

2019-02-17 00:42:09 1285

原创 urllib在python2和python3区别变动

在Python中,我们通常使用urllib中的urlencode方法将字典编码,用于提交数据给url等操作,但是在Python2和Python3中urllib模块中所提供的urlencode的包位置有些不同对于Python2Python2中提供了urllib和urllib2两个模块。urlencode方法所在位置为:urllib.urlencode(values) # 其中v...

2019-02-16 20:53:20 145

原创 关于接口的基础到进阶你要知道的知识

想了很久,闲来无事,今天想了下还是总结了下写下来,部分参考官方源码理解,还有就是这么久的理解,如果觉得有帮助请记得点赞先讲下接口url组成拿后台服务为例 通常一个后台请求url格式:http://www.gamma.tools.hw.com/PipelineSvr/v1/exeplan?plan=plan_002&scheme=scheme_001当然你也可以直接nsloo...

2019-02-16 00:54:39 267

原创 python接口自动化读取json,yaml配置文件+封装requests+unittest+HTMLRunner实现全自动化

1.封装get,post,delete,post请求 api文件 # coding=utf-8import jsonimport requestsclass TestApi(object): """ /* @param: @session ,@cookies the request can be divided into session...

2019-01-23 23:23:52 1150 1

原创 如何写入读取yaml,json文件

# coding=utf-8from ruamel import yamlimport json""" /* @:param version python3.7 python -m pip install ruamel.yaml python None===>>json nullpython True===>>jso...

2019-01-22 20:50:00 1783

原创 接口请求封装get,post增,put修改,delete封装入cookie,session两种模式

# coding=utf-8import jsonimport requestsclass TestApi(object): """ /* @param: @session ,@cookies the request can be divided into session request and cookie request accordi...

2019-01-21 23:36:39 575

原创 Git server 服务器搭建以Gitblit为例

环境配置:windows64bit 系统jdk1.8安装配置环境变量,这个不说了百度有gitblit官网下载对应操作系统位数64bit包解压:http://www.gitblit.com/第七步:创建用于存储资料的文件夹。j解压到D:\Git\ 下并在Git下新建Gitproject空文件第八步:配置gitblit.properties 文件。找到Git目录下的...

2019-01-20 02:08:38 288

原创 git乌龟http/https以及ssh clone的秘钥配置永久免密码登录设置

1.安装安装Git安装TortoiseGit 乌龟客户端首先下载安装一个git客户端这个就不多说了基本就是next一直到底安装后首次新建一个项目project在git服务器上2.配置1.注册用户,让git知道你是谁,在于提交代码的时候,知道是哪个家伙提交的!git config --global user.name  "chen1932490299"    用户名是git...

2019-01-20 01:44:41 1378 1

原创 pytest 运行用例失败重跑并截图到测试html报告

1.环境准备/*@param:作者:流浪的python Date:2019/01/19env:python 3.7(由于3.0-3.5以下部分pytest可能有部分兼容问题安装建议2.7-2.9,3.5-最新)pip install pytest专属 pytest框架包pip install pytest-html  pytest自己专属报告包pip install p...

2019-01-20 00:21:42 4001

原创 pytest+allure环境搭建

配置:/*@param:    @env: windows64bit    @version python 3.7 amdx86-64bit    @author:Chenquan    @Date: 2019.01.19安装jdk1.8,这个由于allure-commandline基于java,jdk环境变量配置就不说了;pip install pytestp...

2019-01-19 23:43:54 1672

原创 pytest 接口测试练手玩具

# coding=utf-8import requestsimport pytest""" /* @param: version: python3.7 pip install pytest pip install pytest-html */"""class GetInitParams(object): def...

2019-01-19 22:14:10 244

原创 pytest自动化运用实战

环境python 3.7 由于3.0-3.5以下部分pytest可能有部分兼容问题安装建议2.7-2.9,3.5-最新pip install pytest专属 pytest框架包pip install  allure-pytest 专属allure的报告包后面会用到可以不安装这里pip install pytest-html  pytest自己专属报告包pip install ...

2019-01-19 21:46:38 525

原创 python pymysql连接数据库自动化脚本批量插入,查询,update,delete封装代码优化以及环境config.ini文件配置

config.ini# coding=utf-8[beta]ip=10.112.123.98port=3306user=adminpwd=pwd@127see_db=see_dbec_db=ec_db[alpha]ip=10.98.96.56port=3307user=adminpwd=pwd@127see_db=see_dbec_db=ec_db# cod...

2019-01-19 21:11:43 1186

原创 postman并发接口

1.配置环境变量cookie,设置ssl验证跳过verify安全验证针对https类型,设置ssl 为off   2.配置cookie环境变量key和value,点击add新建,update保存,环境名称自定义随意,VARIABLES也随意,但是initial value 必须对3.下拉选取后面新建接口文件的环境变量,因为postman默认是按文件保存请求的...

2019-01-12 22:11:39 732

原创 Jmeter参数化csv读取,json path extractor,以及正则提取运用

csv文件格式,新建一个config.csv文件存储账号密码config.csvuser,pwdadmin1,123456devloper,654321manafer,123456test,1111111.先由于jmeter其实就是不断添加插件实现功能的所以介绍csv数据获取的插件新建2.认识一下这个插件参数含义3.介绍用户定义变量插件,作用用户自定义变量...

2019-01-12 21:50:01 807

原创 jmter参数化

  1.csv文件读取插件22.用户定义变量插件3,信息头header插件4.cookie管理器插件5.http请求登录参数化用户密码账号6、提取登录返回token将token参数化关联,方法有两种场景:假如登陆后返回response有token{"id":10001,"data": ["token": "dfds335dsxdetrytyb...

2019-01-12 21:26:31 238

原创 多线程并发玩具

# coding=utf-8import threadingimport time mutex = threading.Lock()class TestTreading(threading.Thread): def __init__(self,id): threading.Thread.__init__(self) self.id =id...

2018-12-27 23:46:09 145

原创 基础认识多线程并发,资源抢占,资源加锁

前尘篇:pt1首先不加锁看看资源会怎么样# coding=utf-8import threadingimport timek =1def walk(n): global k k = k+n k= k-n print "我是悟空||菩萨在此"def run(n): for j i...

2018-11-25 23:11:47 1580 4

原创 ddt+unittest+Excel接口测试自动化

1.编写读取excelf类ReadExcel.py# coding=utf-8import xlrdimport sysimport inspectclass Excel(object): def __init__(self,excel_path,sheet_name): self.excel_file=xlrd.open_workbook(exc...

2018-11-23 00:04:54 533 1

原创 python 爬虫之cookie操作与获取到本地文件进行登录

# coding=utf-8import cookielibimport urllib2import requests""" CookieJar 派生FilecookieJar 再派生出 MozillaCookieJar,urllib2不能够操作网页cookie的高级操作,才引入build_opener操作cookie"""class CookieClass(object): ...

2018-11-21 22:49:29 758

原创 python cookie处理放在头部请求和单独存放字典

# coding:utf-8import requestsfrom bs4 import BeautifulSoupcookie = '''cisession=19dfd70a27ec0eecf1fe3fc2e48b7f91c7c83c60;CNZZDATA1000201968=1815846425-1478580135-https%253A%252F%252Fwww.baidu.com...

2018-11-21 22:36:48 1374

原创 python接口请求ssl安全验证跳过,警告解除InsecureRequestWarning解决办法

在这里插入代码片coding=utf-8import requestsimport urllib3“”“python 跳过安全验证ssl解除InsecureRequestWarning”""urllib3.disable_warnings()r=requests.get(url=“https://www.baidu.com/”,verify=False)print r.elapse...

2018-11-16 23:25:46 1891

原创 利用session请求和cookie请求,token比较特殊不同于前面二者后面补上在这边文章末尾

先说session吧:众所周知http请求是无状态的,需要靠session来维持会话,而session与cookie又紧密联系通过存储在cookie里面的sessionid;接下来讲如何利用这一机制发送请求"""pt:1session保持发送登陆后的接口请求"""# coding=utf-8import jsonimport requestsimport unittestc

2018-11-14 20:55:40 671

原创 python 基础logging模块自定义封装,同时输出到本地文件夹以及python控制台

coding=utf-8import loggingimport osimport timeimport logging.handlersclass TestLogger(object):def init(self, log_dir_path):# logs 文件父目录self.log_dir_path = log_dir_pathif os.path.exists(log_...

2018-11-11 16:20:27 908

原创 python自动化解决验证码以及滑块验证跳过,拿邮箱为例

# coding =utf-8from selenium import webdriverfrom time import sleepdef access_code(): driver=webdriver.Chrome() driver.implicitly_wait(5) driver.get("https://mail.qq.com/cgi-bin/frame...

2018-11-08 21:23:48 2529

原创 selenium自动化PageObject应用实例unittest+ PageObject+html测试报告

basic_info.py# coding =utf-8import timeclass PageObject(object): def __init__(self, driver): self.driver = driver def test(self): ele = self.driver.find_element_by_id("me...

2018-11-08 00:32:24 537

原创 python unittest 测试用例的添加

# coding=utf-8from selenium import webdriverimport unittestclass Login(unittest.TestCase): @classmethod def setUpClass(cls): cls.driver = webdriver.Chrome() ...

2018-11-08 00:15:14 645

原创 解决python接口测试返回json乱码问题,解决如下:

req = requests.post(url="http://192.168.229.128:8080/cms/manage/loginJump.do", data={"userAccount": "admin", "loginPwd": "123456"}) res

2018-11-06 22:39:29 2060 2

原创 python自动化代码实现自动发送HTML报告到邮箱以及定时任务

# coding =utf-8import osimport unittestimport timeimport datetimeimport smtplibfrom email.mime.text import MIMETextfrom HTMLTestRunner import HTMLTestRunnerdef all_cases(): case_path...

2018-11-06 20:55:22 1252

原创 fiddler之https抓包实现

https抓包全教程:https://www.cnblogs.com/liulinghua90/p/9109282.html1.清除电脑上的根证书,WIN+R快捷键,输入:certmgr.msc, 然后回车,查找所有fiddler证书,然后删除。(首次安装fiddler请忽略)2.点击“操作” ,第一个'查找证书‘ ,搜索空白框输入fiddler,点击立即查找3.删除所有搜索出来的证书4....

2018-11-05 21:52:07 383

原创 python HTMLTestRunner自动化测试报告美化

由于官方那个太丑了换行输出也会很bug,就没用了,特地整理了下三种类型废话少说:pyhton 2.x的:"""A TestRunner for use with the Python unit testing framework. Itgenerates a HTML report to show the result at a glance.The simplest way to us...

2018-11-05 20:54:54 3762 8

原创 关于python UI Selenium自动化的一个浏览器driver重复调用问题

最开始也是和大多数一样先写个方法去定义一个驱动每次都要传入一个driver对象class PageObject(object): def __init__(self, driver): self.driver = driver def test(self): ele = self.driver.find_element_by_id("menu-...

2019-03-22 22:52:42 1720 1

原创 Python3 logging之日志回滚TimeRotatingFileHandler when="D"日志log文件未删除

TimeRotatingFileHandler 源码解析def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False): BaseRotatingHandler.__init__(self, filename, 'a', enco...

2019-03-10 18:06:09 1506

原创 Python3 logging之日志回滚RotatingFileHandler

import loggingimport osimport timeimport loggingimport logging.handlerslog_dir_path=os.getcwd()+"/logs"log_dir_path = log_dir_pathif os.path.exists(log_dir_path) and os.path.isdir(log_dir_path...

2019-03-10 03:36:18 1101

原创 解决java log4j 配置log4jCaused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager

前提安装http://mirror.bit.edu.cn/apache/logging/log4j/2.11.2/apache-log4j-2.11.2-bin.zipBuildpath 配置add extend jar : log4j-1.2.17.jarproject/src/下新建log4j配置文件安装完成配置完后依然报错Caused by: java.lang.Class...

2019-03-07 22:32:54 5945 1

原创 jenkins持续集成构建自动化+crontab定时

1. 官网2.7jenkins.war下载http://mirrors.jenkins.io/war-stable/2.73.2/jenkins.warjdk-x86 linux 32bit适用https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-l...

2019-03-06 22:58:49 616

原创 java 递归文件夹,返回文件以及文件目录绝对路径和文件名称

getPath() 方法跟创建 File 对象时传入的路径参数有关,返回构造时传入的路径getAbsolutePath() 方法返回文件的绝对路径,如果构造的时候是全路径就直接返回全路径,如果构造时是相对路径,就返回当前目录的路径 + 构造 File 对象时的路径getCanonicalPath() 方法返回绝对路径,会把 ..\ 、.\ 这样的符号解析掉分别按顺序如下:test\.....

2019-03-06 20:38:05 617

原创 java httpclient文件上传下载接口实现

// download file ,两个都要带路径 public static void downloadfile(String url,String localfileName,String remotefileName) { FileOutputStream output = null; InputStream in = null; CloseableHttpClient h...

2019-03-05 23:42:21 1638

原创 java利用 ganymed-ssh2-build.jar来上传文件到linux以及下载linux文件以及执行linux shell命令

相关ssh2 jar包地址:http://www.ganymed.ethz.ch/ssh2/ganymed-ssh2-build210.ziplogger相关slf4j jar包地址:https://www.slf4j.org/dist/slf4j-1.8.0-beta4.ziplog4j1.2.17 jar地址:http://www.apache.org/dyn/closer.cgi/...

2019-03-05 23:17:06 1535 2

原创 Linux 安装python3 .5 解决pip 安装无法成功问题ssl安全阻拦

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl ce...

2019-03-05 00:52:43 1099

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除