1 // 检查点
2 web.reg_find("Text=\"retCode\":\"0000\"",new String[]{"FAIL=NOTFOUND","SaveCount=StatusCount","LAST"});
3
4 // 关联参数
5 web.reg_save_param("token",
6 new String []{
7 "NOTFOUND=ERROR",
8 "LB=loginToken\":\"",
9 "RB=\",",
10 "Search=Body",
11 "LAST"});
12
13
14 // 事务开始点
15 lr.start_transaction("获取LoginToken的事务");
16 // web.set_sockets_option("SSL_VERSION","TLS");
17
18
19 // 接口调用
20 web.custom_request("getLoginToken",
21 "METHOD=POST",
22 new String[]{"URL=http://10.15.1.19/arowanaintl/user/loginByPass",
23 // "Body={\"channelId\"=\"autotest\",\"clientId\"=\"1\"}",
24 "Body=channelId=autotest&clientId=1&phone=0825500100&pass=bfe7c8de45faf6042b42d371f52640ba",
25 "LAST"});
26
27 // lr.output_message(lr.eval_string("{token}"));
28
29 // 判断接口返回是否查询成功
30 if(lr.eval_int("{StatusCount}")==1){
31 // lr.output_message("接口返回成功!");
32 lr.end_transaction("获取LoginToken的事务", lr.PASS);
33
34 }
35 else{
36 lr.end_transaction("获取LoginToken的事务", lr.FAIL);
37 lr.error_message("接口返回失败!");
38 }
39
40
41 // 检查点
42 web.reg_find("Text=\"retCode\":\"0000\"",new String[]{"FAIL=NOTFOUND","SaveCount=StatusCount2","LAST"});
43
44 // 事务开始点
45 lr.start_transaction("接口调用事务");
46 // web.set_sockets_option("SSL_VERSION","TLS");
47
48 //加消息头
49 web.add_header("loginToken",lr.eval_string("{token}"));
50
51 // 接口调用
52 web.custom_request("07-queryUserIncreaseGolds",
53 "METHOD=POST",
54 new String[]{"URL=http://10.15.1.19/arowanaintl/gold/queryUserIncreaseGolds",
55 // "Body={\"channelId\"=\"autotest\",\"clientId\"=\"1\"}",
56 "Body=channelId=autotest&clientId=123456&uid=88192b97-9b18-4e28-9dce-f9e9bb3f3bd1",
57 "LAST"});
58 //
59
60 // 判断接口返回是否查询成功
61 if(lr.eval_int("{StatusCount2}")==1){
62 // lr.output_message("接口返回成功!");
63 lr.end_transaction("接口调用事务", lr.PASS);
64
65 }
66 else{
67 lr.end_transaction("接口调用事务", lr.FAIL);
68 lr.error_message("接口返回失败!");
69 }