当前位置:网站首页>2天,利用下班后的4小时开发一个测试工具
2天,利用下班后的4小时开发一个测试工具
2020-11-08 09:45:00 【osc_o1iwxx3z】
源码和安装包:
git路径:https://github.com/yzxwp/test_Autotool.git
安装包下载:链接:https://pan.baidu.com/s/1w6AeBx2I1d9FZDxR6rcuMw 提取码:GGMM
开发原因:
现在我主要从事汽车金融项目的测试工作,身边的同事告诉我,测试用的数据好难造,例如身份证号码,统一社会征信码,车辆车架号等数据校验复杂,直接取数据库中的数据牵扯到可以的信息,脱敏后数据可能是用不了,网上的在线生成工具因网络权限问题无法获得,还有的同事拥有外网权限,但是这些网站有的时候不知道什么原因会关闭一段时间,因此制造一条数据可能需要很久,为了提高测试效率和质量,避免宝贵的测试时间浪费在制造数据上,所以我结合网上的数生成规则,对于已有的方法实现的直接cv大法,没有的自己写了一下,写了这个自动生成测试数据的小程序。
使用方法:
将exe文件下载下来,git和百度云都可以,将他们放到桌面或者合适的路径中。
然后直接双击打开。
点击右边的重新获取数据,可以获取新的数据在文本框中,点击最下面重新获取全部数据,可以将所有的数据刷新。
之前是做后端开发的,不太懂前端技术,看了一下午tkinter,自己写的残废GUI页面,希望诸位大佬们批评指正。
class demo():
def __init__(self):
self.root = Tk()
self.root.title("自动生成测试数据小工具") # 设置窗口标题
# self.root.attributes("-toolwindow", 1)
dd.center_window(self.root, 340, 280)
self.way()
def way(self):
#全部刷新
Button(self.root, text='重新获取全部数据:', command=self.text_all).grid(row=8, column=2, sticky=W)
# 用户姓名
self.lab_name = Label(self.root, text='用 户 姓 名 :').grid(row=0, column=1)
self.text_name = Text(self.root, height=1, width=20)
self.text_name.insert('0.0', name.random_name())
self.text_name.grid(row=0, column=2, sticky=W)
self.text_name_click = Button(self.root, text='重新获取:',command=self.text_name1).grid(row=0, column=3, sticky=W)
# 手机号码
self.lab_phone = Label(self.root, text='手 机 号 码 :').grid(row=1, column=1)
self.text_phone = Text(self.root, height=1, width=20)
self.text_phone.insert('0.0', phone.phone_num())
self.text_phone.grid(row=1, column=2, sticky=W)
self.text_phone_click = Button(self.root, text='重新获取:',command=self.text_phone1).grid(row=1, column=3, sticky=W)
# 身份证号码
self.lab_idcard = Label(self.root, text='身 份 证 号 码 :').grid(row=2, column=1)
self.text_idcard = Text(self.root, height=1, width=20)
self.text_idcard.insert('0.0', id_card.main())
self.text_idcard.grid(row=2, column=2, sticky=W)
self.text_idcard_click = Button(self.root, text='重新获取:',command=self.text_idcard1).grid(row=2, column=3, sticky=W)
# 统一社会征信码
self.lab_tyshzxm = Label(self.root, text='统一社会征信码:').grid(row=3, column=1)
self.text_tyshzxm = Text(self.root, height=1, width=20)
self.text_tyshzxm.insert('0.0', id_credit.create_social_credit())
self.text_tyshzxm.grid(row=3, column=2, sticky=W)
self.text_tyshzxm_click = Button(self.root, text='重新获取:',command=self.text_tyshzxm1).grid(row=3, column=3, sticky=W)
# 组织机构代码
self.lab_zzjgdm = Label(self.root, text='组织 机构 代码:').grid(row=4, column=1)
self.text_zzjgdm = Text(self.root, height=1, width=20)
self.text_zzjgdm.insert('0.0', id_credit.create_organization())
self.text_zzjgdm.grid(row=4, column=2, sticky=W)
self.text_zzjgdm_click = Button(self.root, text='重新获取:',command=self.text_zzjgdm1).grid(row=4, column=3, sticky=W)
#随机获得车架号
self.lab_vin = Label(self.root, text='车辆 车架 号:').grid(row=5, column=1)
self.text_vin = Text(self.root, height=1, width=20)
self.text_vin.insert('0.0', vin.random_vin())
self.text_vin.grid(row=5, column=2, sticky=W)
self.text_vin_click = Button(self.root, text='重新获取:',command=self.text_vin1).grid(row=5, column=3, sticky=W)
# 随机获得工行银行卡
self.lab_bank_gon = Label(self.root, text='工行 银行卡号:').grid(row=6, column=1)
self.text_bank_gon = Text(self.root, height=1, width=20)
self.text_bank_gon.insert('0.0', bank_card.gen_bank_card_nonghang())
self.text_bank_gon.grid(row=6, column=2, sticky=W)
self.text_bank_gon_click = Button(self.root, text='重新获取:',command=self.text_bank_gon1).grid(row=6, column=3, sticky=W)
# 随机获得农行银行卡
self.lab_bank_non = Label(self.root, text='农行 银行卡号:').grid(row=7, column=1)
self.text_bank_non = Text(self.root, height=1, width=20)
self.text_bank_non.insert('0.0', bank_card.gen_bank_card_gonghang())
self.text_bank_non.grid(row=7, column=2, sticky=W)
self.text_bank_non_click = Button(self.root, text='重新获取:',command=self.text_bank_non1).grid(row=7, column=3, sticky=W)
self.root.mainloop()
def text_name1(self):
self.text_name.delete('0.0', END)
self.text_name.insert('0.0', name.random_name())
def text_phone1(self):
self.text_phone.delete('0.0', END)
self.text_phone.insert('0.0', phone.phone_num())
def text_idcard1(self):
self.text_idcard.delete('0.0', END)
self.text_idcard.insert('0.0',id_card.main())
def text_tyshzxm1(self):
self.text_tyshzxm.delete('0.0', END)
self.text_tyshzxm.insert('0.0', id_credit.create_social_credit())
def text_zzjgdm1(self):
self.text_zzjgdm.delete('0.0', END)
self.text_zzjgdm.insert('0.0', id_credit.create_organization())
def text_vin1(self):
self.text_vin.delete('0.0', END)
self.text_vin.insert('0.0', vin.random_vin())
def text_bank_gon1(self):
self.text_bank_gon.delete('0.0', END)
self.text_bank_gon.insert('0.0', bank_card.gen_bank_card_gonghang())
def text_bank_non1(self):
self.text_bank_non.delete('0.0', END)
self.text_bank_non.insert('0.0', bank_card.gen_bank_card_nonghang())
def text_all(self):
self.text_name.delete('0.0', END)
self.text_name.insert('0.0', name.random_name())
self.text_phone.delete('0.0', END)
self.text_phone.insert('0.0', phone.phone_num())
self.text_idcard.delete('0.0', END)
self.text_idcard.insert('0.0', id_card.main())
self.text_tyshzxm.delete('0.0', END)
self.text_tyshzxm.insert('0.0', id_credit.create_social_credit())
self.text_zzjgdm.delete('0.0', END)
self.text_zzjgdm.insert('0.0', id_credit.create_organization())
self.text_vin.delete('0.0', END)
self.text_vin.insert('0.0', vin.random_vin())
self.text_bank_gon.delete('0.0', END)
self.text_bank_gon.insert('0.0', bank_card.gen_bank_card_gonghang())
self.text_bank_non.delete('0.0', END)
self.text_bank_non.insert('0.0', bank_card.gen_bank_card_nonghang())
这个小工具已经投入使用了,获得了同事们的一致好评,大大节约了同事们的时间。后续优化已经准备好了,最近收集了同事们的建议,增加一些数据,例如:中征码,五大行另外三家的卡号等。
后续我还会开发一个monkey的小工具,能够自动生成monkey命令,自动获取手机devices等信息,
版权声明
本文为[osc_o1iwxx3z]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4390903/blog/4707937
边栏推荐
- VC++指定目录下文件按时间排序输出
- How can a technician take over a complex system?
- 1. In depth istio: how is sidecar auto injection realized?
- Experience the latest version of erofs on Ubuntu
- 哔哩哔哩常用api
- Python3.9的7个特性
- 2020-11-05
- Astra: Apache Cassandra的未来是云原生
- Swiper window width changes, page width height changes lead to automatic sliding solution
- 个人短网址生成平台 自定义域名、开启防红、统计访问量
猜你喜欢
麦格理银行借助DataStax Enterprise (DSE) 驱动数字化转型
高并发,你真的理解透彻了吗?
Wechat nickname Emoji expression, special expression causes the list not to be displayed, export excel error report and other problems solved!
Astra: Apache Cassandra的未来是云原生
IOS upload app store error: this action cannot be completed - 22421 solution
墨者学院SQL注入解题
PCIe 枚举过程
阅读心得:FGAGT: Flow-Guided Adaptive Graph Tracking
Ulab 1.0.0 release
python学习 day1——基础学习
随机推荐
VC++指定目录下文件按时间排序输出
Review the cloud computing application scenarios you didn't expect (Part 1)
鼠标变小手
The difference between vivoy 73s and glory 30 Youth Edition
Ulab 1.0.0 release
分布式共识机制
python学习 day1——基础学习
Oops, the system is under attack again
Solve the problem of rabbitmq message loss and repeated consumption
Windows subsystem Ubuntu installation
“智能5G”引领世界,数位智能网优+5G能带来什么?
Astra: the future of Apache Cassandra is cloud native
Six key points of data science interview
Interface
游戏优化性能杂谈(十一) - 知乎
PCR and PTS calculation and inverse operation in TS stream
进程、线程和协程的区别
5G+AR出圈,中国移动咪咕成第33届中国电影金鸡奖全程战略合作伙伴
【原创】关于高版本poi autoSizeColumn方法异常的情况
盘点那些你没想到的云计算应用场景(上)