自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 python的数据库操作

'''连接数据库'''import pymysqldef mysql(): # 连接数据库 hostvalue = 'hostvalue ' uservalue = 'uservalue ' passwordvalue = 'passwordvalue ' dbvalue = 'dbvalue ' ...

2019-12-31 17:11:19 120

原创 对Excel的基本操作

Excel的基本操作# 导入模块import xlsxwriter# 新建excel表work = xlsxwriter.Workbook('new_excel.xlsx')# 新建sheet(sheet的名称为"sheet1")worksheet = work.add_worksheet('sheet1')# 设置表头headings = ['Number', 'testA', ...

2019-12-17 09:13:51 152

原创 半自动化实现12306抢票

半自动化实现12306抢票from selenium import webdriver# 处理下拉框元素from selenium.webdriver.support.select import Select# 时间函数from winsound import Beepimport timedriver = webdriver.Chrome()driver.get('https:...

2019-12-16 14:22:25 180

翻译 接口的压力测试

接口的压力测试import jsonimport requestsimport logginglogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')logger = logging.getLogger(__name__)restim...

2019-11-11 10:56:33 366

转载 python+requests读取Excel接口信息,来做接口测试,测试结果填写到Excel表格中

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。本文链接:https://blog.csdn.net/qq_42846555/article/details/97761484读取Excel接口信息,来做接口测试,测试结果填写到Excel表格中测试前表格:import osimport timeimport requestsim...

2019-08-26 17:20:55 810

翻译 monkey常见的命令

1.安装成功后的验证命令,查看monkey版本adb version2.查看连接设备命令adb devices3.列出手机里面全部安装的包的名称adb shell pm list packages4.安装软件adb install package5.卸载软件adb uninstall packages6.Monkey给手机百度这个app做随机1000个事件adb ...

2019-04-28 16:17:42 314

翻译 python3优化测试报告显示,饼图和通过率

#coding=utf-8"""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 use this is to invoke its main method. E.g...

2019-03-26 16:45:04 806

原创 python3优化测试报告显示,增加多种图表和通过率

增加图表显示,针对python3"""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 use this is to invoke its main method. ...

2019-03-22 10:30:25 332

原创 BSTestRunner文件

BSTestRunner文件"""A TestRunner for use with the Python unit testing framework. It generates a HTML report to show the result at a glance.The simplest way to use this is to invoke its main method. E....

2019-03-21 18:33:33 1618

原创 python+selenium 断言的常用方法

断言的常用方法assertEqual(a,b,[msg=‘测试失败时打印的信息’]): 断言a和b是否相等,相等则测试用例通过。assertNotEqual(a,b,[msg=‘测试失败时打印的信息’]): 断言a和b是否相等,不相等则测试用例通过。assertTrue(x,[msg=‘测试失败时打印的信息’]): 断言x是否True,是True则测试用例通过。assertFalse(x,...

2019-03-18 17:36:40 1677

原创 HTMLTestRunner文件

"""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 use this is to invoke its main method. E.g. import...

2019-02-28 16:23:53 128

转载 Mysql常用命令行大全

```Mysql常用命令行大全1、连接Mysql格式: mysql -h主机地址 -u用户名 -p用户密码1、连接到本机上的MYSQL。首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root -p,回车后提示你输密码.注意用户名前可以有空格也可以没有空格,但是密码前必须没有空格,否则让你重新输入密码。如果刚安装好MYSQL,超级用户root是没有密码...

2019-02-28 11:02:13 259

原创 Python+Selenium:自动化测试报告的生成

TestRunner.pyimport HTMLTestRunnerimport osimport unittestimport timeimport smtplibfrom email.mime.text import MIMETextfrom email.header import Header# 设置报告文件保存路径report_path = os.path.dirnam...

2019-02-28 10:57:43 1525

原创 发送自动化测试报告到自己的邮箱

# 发送到邮箱#邮箱服务器smtpserver = 'smtp.163.com'#发送邮箱sender = '[email protected]'#发送邮箱的账号密码username = '[email protected]'password = 'password'#发送邮件主题subject = '自动化测试报告'#接收邮箱receiver = 'username@163....

2019-02-28 10:54:56 2093 1

原创 GIT 基础操作命令

GIT 基础操作命令 * 初始化新版本库:git init * 全局设置:git config --global user.name "xzavier" git config --global user.email "xzavier.xxx.com" * 克隆版本库:git clone "url" * 查看分支:git branch * 创建分支:git branch branch_n...

2019-02-27 15:46:56 96

转载 linux常用命令手册

系统信息arch 显示机器的处理器架构(1)uname -m 显示机器的处理器架构(2)uname -r 显示正在使用的内核版本dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI)hdparm -i /dev/hda 罗列一个磁盘的架构特性hdparm -tT /dev/sda 在磁盘上执行测试性读取操作cat /proc/cpuinfo 显示CPU info...

2019-02-27 15:35:11 296

原创 Python+Selenium框架设计篇之unittest执行脚本方法之makeSuite()

目录的文档的创建TestRunner.py``import unittestfrom automation_framework_demo.testsuits.baidu_search import BaiduSearchfrom automation_framework_demo.testsuits.baidu_search2 import BaiduSearch2suite = ...

2019-01-28 17:26:47 654

转载 Python+Selenium框架内封装日志类和浏览器引擎类

1.创建如下格式的项目层级结构,文件名称保持一致2.2. 相关文件代码如下配置文件config.ini相关设计如下: #this is config file, only store browser type and server URL[browserType]browserName = Chrome[testServer]URL = https://www.baidu.co...

2019-01-24 09:33:32 523

转载 selenium之 定位以及切换frame(iframe)

很多人在这样写的时候会发现,switch_to_frame()这句话被划上了删除线,原因是这个方法已经out了,之后很有可能会不支持,建议的写法是switch_to.frame(),当遇到元素无法定位时,要查看下是否含有frame标签,若有,则可能是该标签带来的影响。frame标签有frameset、frame、iframe三种,frameset跟其他普通标签没有区别,不会影响到正常的定位,而f...

2019-01-22 19:26:44 2156 1

转载 Python+Selenium unittest单元测试框架

新建一个testbaidu.py的文件导入unittest模块当前测试类继承unittest.TestCase,相当于当前利用unittest创建了一个test case,这个test case是能够被unittest直接识别。写setUP(),主要是打开浏览器和打开站点写一个test_search()用例写搜索的代码写tearDown(),主要是浏览器退出操作coding=utf...

2019-01-21 10:34:00 476

转载 Selenium中使用xpath的定位

Selenium中使用xpath的定位1)绝对路径:从DOM结构树的开始一直写到你需要定位的那个节点ps:这样的情况基本只有一种情况才会出现,那就是所有的标签都重复,所有的属性都重复,不然打死我也不用这个办法。2)相对路径:eg:"//span"其中 ‘//’ 标识忽略前面的所有节点,直接定位当前节点(例子的中当前节点为:span)3)切片引索定位:eg:"//span[0...

2019-01-18 16:44:11 226

转载 python画小猪佩奇

from turtle import*def nose(x,y):#鼻子 penup()#提起笔 goto(x,y)#定位 pendown()#落笔,开始画 setheading(-30)#将乌龟的方向设置为to_angle/为数字(0-东、90-北、180-西、270-南) begin_fill()#准备开始填充图形 a=0.4 fo...

2019-01-18 15:26:04 208 1

原创 python+selenium一些基本的方法

from selenium import webdriverimport reimport timefrom selenium.webdriver.common.keys import Keysdriver = webdriver.Chrome("C:\\Users\suxiahua\AppData\Local\Programs\Python\Python36\Lib\site-pa...

2019-01-17 17:13:38 110

原创 爬取图片的URL和下载图片

# 爬取图片的URLfrom selenium import webdriverimport urllib.requestimport timefrom urllib.request import urlopen, urlretrieve# 下载处理def imgDownload(imgUrl): urlretrieve(imgUrl, 'D://susu/picture/...

2019-01-17 17:10:41 683

转载 Selenium常用的方法总结

发起请求:driver.get(url)获取请求网页的标题:driver.title()获取某元素ID中的内容:find_element_by_id(‘id名称’)获取某元素ID中的所有内容:find_elements_by_id(‘id名称’)获取某xpath中的内容:find_element_by_xpath(xpath)获取某xpath中的内容:find_elements_by_x...

2019-01-17 17:08:48 187

原创 selenium设置谷歌无头浏览器

from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionschrome_options = Options()chrome_options.add_argument('--headless')driver = webdriver.Chrome(chrome_options=chrom...

2018-11-27 10:57:10 677

原创 python+selenium在文本框中传入键值

python+selenium在文本框中传入键值from selenium import webdriverdriver.find_element_by_class_name("login").click()driver.find_element_by_id("schoolProvince").send_keys("福建省")find_element_by_class_name该函数根据...

2018-11-26 16:59:41 2034

转载 Python+Selenium 自动化实现实例-获取页面元素信息

Python+Selenium 自动化实现实例-获取页面元素信息from selenium import webdriverdriver = webdriver.Chrome("C:\\Users\suxiahua\AppData\Local\Programs\Python\Python36\Lib\site-packages\chromedriver_win32\chromedriver....

2018-11-26 15:38:11 2107

原创 python读取excel文件

python读取excel文件适用于python3.6版本#coding=utf-8import xlrd#获取数据data = xlrd.open_workbook('language.xlsx', encoding_override='utf-8')#获取sheettable = data.sheet_by_name('tablelist')#获取总行数nrows = ...

2018-11-07 17:28:37 180

原创 python输出文档为utf-8格式的文档

python在不同的版本参数是不一样的,在3版本中,输出的文档格式应该放在文档打开的函数上# coding= utf-8import jsonoutputFilePath = "/Users/suxiahua/Desktop/1111.json"jsonStr =json.dumps({'text':"福建欢迎"},ensure_ascii=False,indent=2)with op

2018-11-01 17:10:08 3208

原创 postman批量参数导入

postman批量参数导入版权声明:本文为博主原创文章,未经博主允许不得转载。希望对你们有用!第一步第二步注意事项:文档最好保存成CSV格式的,并是utf-8编码方式,因为本人保存成TXT格式的,运行会报错,暂时未找到原因。第三步保存到collections项目中,设置参数最后点击运行就可以了打开运行日志查看具体赋值...

2018-10-31 17:01:59 5747

转载 Markdown编辑器基本语法

Markdown编辑器基本语法功能快捷键撤销:Ctrl/Command + Z重做:Ctrl/Command + Y加粗:Ctrl/Command + B斜体:Ctrl/Command + I标题:Ctrl/Command + Shift + H无序列表:Ctrl/Command + Shift + U有序列表:Ctrl/Command + Shift + O检查列表:Ctrl/...

2018-10-30 16:38:41 113

空空如也

空空如也

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

TA关注的人

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