当前位置:网站首页>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
边栏推荐
- How does spotify drive data-driven decision making?
- Face recognition: attack types and anti spoofing techniques
- More than 50 object detection datasets from different industries
- PCR and PTS calculation and inverse operation in TS stream
- “1024”征文活动结果新鲜出炉!快来看看是否榜上有名?~~
- Macquarie Bank drives digital transformation with datastex enterprise (DSE)
- Rust: command line parameter and environment variable operation
- Is there a big difference between i5 1135g7 and i51035g1? Which is better?
- Six key points of data science interview
- 糟糕,系统又被攻击了
猜你喜欢
November 07, 2020: given an array of positive integers, the sum of two numbers equals N and must exist. How to find the two numbers with the smallest multiplication?
ASP.NET MVC下基于异常处理的完整解决方案
More than 50 object detection datasets from different industries
vivoY73s和vivoY70s的区别 vivoY73s和vivoY70s哪个值得入手
Do you really understand the high concurrency?
2020-11-05
Rust: command line parameter and environment variable operation
python学习 day1——基础学习
软件测试培训班出来好找工作么
麦格理银行借助DataStax Enterprise (DSE) 驱动数字化转型
随机推荐
架构师(2020年11月)
鼠标变小手
413【毕设课设】基于51单片机无线zigbee无线智能家居光照温湿度传输监测系统
糟糕,系统又被攻击了
Test requirements for MIC certification of Bluetooth 2.4G products in Japan
print( 'Hello,NumPy!' )
计算机网络基本概念(五)局域网基本原理
iOS上传App Store报错:this action cannot be completed -22421 解决方案
Solve the problem of rabbitmq message loss and repeated consumption
laravel8更新之速率限制改进
nvm
数据科学面试应关注的6个要点
Distributed consensus mechanism
Insight -- the application of sanet in arbitrary style transfer
搜索引擎的日常挑战_4_外部异构资源 - 知乎
Review the cloud computing application scenarios you didn't expect (Part 1)
Recommend an economic science video, very valuable!
Which is more worth starting with the difference between vivos7e and vivos7
AMD Zen3首发评测:频率超5GHz,IPC提升不止19%,这次真的Yes了 - 知乎
laravel8更新之速率限制改进