码迷,mamicode.com
首页 > 编程语言 > 详细

python接口测试-充值

时间:2019-01-07 21:13:01      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:and   port   encode   flag   div   amt   phone   col   dac   

import requests
import json
import unittest
import HTMLTestRunner

telphone =18200717087 #参数化手机号码

ur1=http://--:8081/systLogonUser/adminLogon.do
headers = {Content-Type:application/x-www-form-urlencoded,Referer:118.178.247.67}
data = {
    userName:telphone ,
    pwd: 123456Aa,
    verifyCode: 121
}
r = requests.post(url=ur1,data=data,headers=headers)
repones = r.text
print(1,r.text)
print(2,r.status_code)
print(3,r.text[12:28])
fundAcc=r.text[12:28]  #获取存管=账号


custName= 严春雪   #参数化
DraweeAccNo = 6222023602807200471  #参数化
# fundAcc = 9595100066088003

ur12=http://--:10100/p2pGate/recharge/recharge.html
headers2 = {Content-Type:application/x-www-form-urlencoded,Referer:10.139.39.43:8620}
data2 = {
"Amt":"403",
"channel":"1001",
"CurrType":"RMB",
"DraweeAccName":custName, #参数化
"DraweeAccNo":DraweeAccNo, #参数化
"DraweePath":"0002",
"DraweeVoucherType":"4099",
"DraweeVoucherNo":"0000000000000000",
"enviro":0,
"FromFlag":3,
"HostPrdCode":"993010000000000000",
# "orderId":"301012015jf711174392154410${__Random(1000,9999,ord)}",
"orderId":"301012015jf7111743921544107",
"PayeeAccName":"首金存管结算户(客户资金专户)",
"PayeeAccNo":"600161178",
"Summary":fundAcc #参数化
}
r = requests.post(url=ur12,data=data2,headers=headers2)
repones = r.text
# print(‘heheda1:‘,r.text)
print(heheda2,r.status_code)
print(4,chognzhi)

 

python接口测试-充值

标签:and   port   encode   flag   div   amt   phone   col   dac   

原文地址:https://www.cnblogs.com/jpr-ok/p/10234942.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!