- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 封装元素是否显示、属性、执行方法
# -*- coding:utf-8 -*-import timefrom selenium.webdriver.support.ui import WebDriverWait#from publicmethod import pcdriver class ElementMethod():def __init__(self,driver):self.dr=driv...
2018-11-27 18:27:02
198
原创 python格式化swagger文档接口
生成接口格式的方法: # -*- coding:utf8 -*-import jsonfrom idcm import interfaces class Interface():def writefilename(self,data):try:if data!='':with open('E:\interface\\'+data+'.py', 'w+', e...
2018-11-27 18:23:34
3814
转载 python自带的排列组合函数
需求: 在你的面前有一个n阶的台阶,你一步只能上1级或者2级,请计算出你可以采用多少种不同的方法爬完这个楼梯?输入一个正整数表示这个台阶的级数,输出一个正整数表示有多少种方法爬完这个楼梯。 分析:提炼出题干的意思:用1和2产生不同组合,使得他们的和等于台阶的级数,输出有多少种组合方式。 解决: 主要的问题就是如何利用1和2产生不同的组合,查阅了python关于排列组合相关的资料...
2018-11-09 20:40:43
6319
转载 requests.post()方法中的data、json参数详解
json和dictpython中的dict类型要转换为json格式的数据需要用到json库:import json <json> = json.dumps(<dict>)<dict> = json.loads(<json>)需要注意的是python中并没有json类型这一说法,通过json.dumps(<dict>)转换的字...
2018-11-09 20:25:15
15152
1
原创 jenkins使用Windows batch command执行自动化脚本
1、先参数化构建,如:2、每天凌晨1点执行自动化脚本3、在构建模块使用Windows batch command执行,用参数化构建(choice)的参数来构建要执行的参数,如图PS:这里要注意if "%auto%" == "test1" ( ###这里的==前后要有空格,不然会报错...
2018-06-07 11:49:44
28983
3
原创 使用第三方SMTP发送邮件服务
# 使用第三方SMTP发送邮件服务class SendEmail(): def email(self,tracebac,exception=''): emailhost = "smtp.126.com" # 服务器地址 emailuser = "XXX@126.com" # 用户名 emailpass = "XXX" # 密码(如果1...
2018-06-01 18:15:24
10145
转载 Python中如何输出完整的报错路径及信息(即Exception Stack)及try--exception说明
Python中如何输出完整的报错路径及信息(即Exception Stack)try: addproduct.login()except (Exception,BaseException) as e: addproduct.screenshot() exstr = traceback.format_exc() logs.logs(exstr) print(...
2018-05-30 18:45:58
8035
原创 Appiun与selenium判断页面是否元素是否存在(要用find_element如果找不到元素会报异常,但是find_elements如果找不到元素的话则会返回 [ ] )
selenium:#判断xpath,id元素是否存在def is_element_exist(self, id): # global IsElementExist # IsElementExist=IsElementExist(self.dr) s = self.dr.find_elements_by_id(id) ss=self.dr.find_elements...
2018-05-29 18:06:52
4348
1
原创 selenium环境等需要注意的点
1、TypeError: 'NoneType' object is not iterable 返回数据为空值数据库获取的一个字段的数据,只是一个列表数据,len为1,需要split分隔adb server version (32) doesn't match this client (36)或(35)或(39) 有可能某个应用软件的商品与adb冲突了,如豌豆荚的ppadbserver.exe也...
2018-05-28 09:33:27
378
原创 浏览器自动弹框处理
url = 'http://10.1.1.56:8080/elastic'fdr=self.firefoxdriverfdr.get(url)os.system("E:\\YuFuShop_Auto\\file\\sendkey1.vbs") #结算测试服跑批登录弹出框输入账号密码#这里sendkey1.vbs(脚本详见下面)为什么不用WshShell.sendkeys("{ENTER}"),是...
2018-05-28 09:31:35
1139
原创 appium+python搭建
Windows下搭建appium+python的测试开发环境:1、安装nodejs,下载地址:https://nodejs.org/download/ (配置环境变量)。2、安装Appium (可以直接下载.exe文件直接安装,则不用下面的步骤)https://appium.io/下载完毕后解压到pc本地,将压缩包里有appium.cmd文件的路径设置到环境变量path中验证:ap...
2018-05-28 09:23:23
309
tesseract-ocr-4.0.0
2018-09-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人