做网站的技术性说明,wordpress 地区联动,润和软件是外包公司吗,如何建立官网欢迎关注【无量测试之道】公众号#xff0c;回复【领取资源】,
Python编程学习资源干货、
PythonAppium框架APP的UI自动化、
PythonSelenium框架Web的UI自动化、
PythonUnittest框架API自动化、
资源和代码 免费送啦~
文章下方有公众号二维码#xff0c;可直接微信扫一扫关注…欢迎关注【无量测试之道】公众号回复【领取资源】,
Python编程学习资源干货、
PythonAppium框架APP的UI自动化、
PythonSelenium框架Web的UI自动化、
PythonUnittest框架API自动化、
资源和代码 免费送啦~
文章下方有公众号二维码可直接微信扫一扫关注即可。
本篇文章旨在通过一段JavaScript来演示如何调用python后端服务的这是我开发的一个构建测试数据的工具。
第一部分html 代码部分第二部分JavaScript代码部分第三部分Python后端代码
app.route(/insertInvertory,methods[GET])
def insertInvertory():
envrequest.args.get(env)
coderequest.args.get(code)
datenow time.strftime(%Y-%m-%d)
dbDBUtils(env)
selectsqlSELECT a.id propertyId,c.id roomTypeId,c.code RoomType FROM info.property AS a,info.room_class AS b,info.room_type AS c WHERE a.code code AND b.property_id a.id AND c.room_class_id b.id
resultdb.dbSelect(selectsql)
for i in range(len(result)):
property_idstr(result[i][propertyId])
delsql DELETE FROM inv.property_inventory_detail WHERE property_id property_id AND effective_date str(datenow)
dbs DBUtils(env)
resutls dbs.dbExcute(delsql)
print(the resutls is:,resutls)
print(delsql)
for i in range(len(result)):
property_idstr(result[i][propertyId])
relation_idstr(result[i][roomTypeId])
insertsqlINSERT INTO inv.property_inventory_detail(property_id,relation_type,relation_id,effective_date,original,consume,STATUS,create_time,update_time,deducted,out_order,non_deducted) \
VALUES \
(property_id,4,relation_id,DATE_ADD(str(datenow),INTERVAL 0 DAY),100,0,1,NOW(),NOW(),0,0,0),\
(property_id,4,relation_id,DATE_ADD(str(datenow),INTERVAL 1 DAY),100,0,1,NOW(),NOW(),0,0,0),\
(property_id,4,relation_id,DATE_ADD(str(datenow),INTERVAL 90 DAY),100,0,1,NOW(),NOW(),0,0,0);
dbs DBUtils(env)
resutlsdbs.dbExcute(insertsql)
print(resutls)
print(insertsql)
return jsonify(
{status:200,msg:its success!!!})
第四步执行成功后返回结果总结测试工程师要进步就得不断的学习充电掌握的技能不仅是测试技能越多你对测试的认识也就越深入与君共勉。
备注我的个人公众号已正式开通致力于测试技术的分享包含大数据测试、功能测试测试开发API接口自动化、测试运维、UI自动化测试等微信搜索公众号“无量测试之道”或扫描下方二维码添加关注一起共同成长吧。