Toggle navigation
Toggle navigation
This project
Loading...
Sign in
YPT
/
jmeter
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rong
8 years ago
Commit
46b6b6a902014eadab98be77187a6a8ce61b568c
1 parent
c123541d
commit by shell
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
25 deletions
script/2017_11_11/cart_edit.jmx
script/2017_11_11/cart_edit.jmx
View file @
46b6b6a
...
...
@@ -60,13 +60,13 @@
<boolProp
name=
"ignoreFirstLine"
>
false
</boolProp>
</CSVDataSet>
<hashTree/>
<ThreadGroup
guiclass=
"ThreadGroupGui"
testclass=
"ThreadGroup"
testname=
"购物车-编辑"
enabled=
"true"
>
<ThreadGroup
guiclass=
"ThreadGroupGui"
testclass=
"ThreadGroup"
testname=
"购物车-编辑
add
"
enabled=
"true"
>
<stringProp
name=
"ThreadGroup.on_sample_error"
>
continue
</stringProp>
<elementProp
name=
"ThreadGroup.main_controller"
elementType=
"LoopController"
guiclass=
"LoopControlPanel"
testclass=
"LoopController"
testname=
"循环控制器"
enabled=
"true"
>
<boolProp
name=
"LoopController.continue_forever"
>
false
</boolProp>
<intProp
name=
"LoopController.loops"
>
-1
</intProp>
</elementProp>
<stringProp
name=
"ThreadGroup.num_threads"
>
20
0
</stringProp>
<stringProp
name=
"ThreadGroup.num_threads"
>
15
0
</stringProp>
<stringProp
name=
"ThreadGroup.ramp_time"
>
10
</stringProp>
<longProp
name=
"ThreadGroup.start_time"
>
1501638755000
</longProp>
<longProp
name=
"ThreadGroup.end_time"
>
1501638755000
</longProp>
...
...
@@ -130,7 +130,7 @@ vars.put("searchValue",req+"&client_secret="+md5Str);
</ResponseAssertion>
<hashTree/>
</hashTree>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
increase
"
enabled=
"true"
>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
selectedAndCart
"
enabled=
"true"
>
<elementProp
name=
"HTTPsampler.Arguments"
elementType=
"Arguments"
guiclass=
"HTTPArgumentsPanel"
testclass=
"Arguments"
testname=
"用户定义的变量"
enabled=
"true"
>
<collectionProp
name=
"Arguments.arguments"
/>
</elementProp>
...
...
@@ -151,11 +151,12 @@ vars.put("searchValue",req+"&client_secret="+md5Str);
<hashTree>
<BeanShellPreProcessor
guiclass=
"TestBeanGUI"
testclass=
"BeanShellPreProcessor"
testname=
"前置MD5"
enabled=
"true"
>
<stringProp
name=
"filename"
></stringProp>
<stringProp
name=
"parameters"
>
${uid_cart_edit} ${shopping_key_edit} ${sku_edit}
</stringProp>
<stringProp
name=
"parameters"
>
${uid_cart_edit} ${shopping_key_edit} ${sku_edit}
${__RandomString(1,YN,)}
</stringProp>
<boolProp
name=
"resetInterpreter"
>
false
</boolProp>
<stringProp
name=
"script"
>
import java.security.MessageDigest;
String req =
"
app_version=5.8.1
&
client_type=test
&
fromPage=aFP_ShopCart
&
gender=1,3
&
increase_number=1
&
method=app.Shopping.increase
&
os_version=android4.3:R6007
&
physical_channel=1
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku=
"
+bsh.args[2]+
"&
screen_size=720x1280
&
session_key=b8587bfb19e123bb56d3dabf1a5a80f7
&
shopping_key=
"
+bsh.args[1]+
"&
udid=865852023421405a11b22ab89b6adb8
&
uid=
"
+bsh.args[0]+
"&
v=7
&
yh_channel=1
"
;
String product_sku_list =
"
[{\
"
goods_type\
"
:\
"
ordinary\
"
,\
"
selected\
"
:\
""
+bsh.args[3]+
"
\
"
,\
"
product_sku\
"
:
"
+bsh.args[2]+
"
,\
"
promotion_id\
"
:\
"
\
"
,\
"
buy_number\
"
:\
"
1\
"
}]
"
;
String req =
"
app_version=5.9.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.selectedAndQryCart
&
os_version=yohobuy:h5
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=00ed65eb36a474388df2fa2d6e97a8a5
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
MessageDigest md = MessageDigest.getInstance(
"
MD5
"
);
byte[] btInput = req.getBytes();
...
...
@@ -170,8 +171,10 @@ for(byte b : btResult){
}
sb.append(Integer.toHexString(bt));
}
String md5Str = sb.toString();
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5Str);
String md5code = sb.toString();
product_sku_list=URLEncoder.encode(product_sku_list);
req =
"
app_version=5.9.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.selectedAndQryCart
&
os_version=yohobuy:h5
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=00ed65eb36a474388df2fa2d6e97a8a5
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5code);
</stringProp>
</BeanShellPreProcessor>
<hashTree/>
...
...
@@ -185,7 +188,7 @@ vars.put("searchValue",req+"&client_secret="+md5Str);
</ResponseAssertion>
<hashTree/>
</hashTree>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
decrease
"
enabled=
"true"
>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
removeAndCart
"
enabled=
"true"
>
<elementProp
name=
"HTTPsampler.Arguments"
elementType=
"Arguments"
guiclass=
"HTTPArgumentsPanel"
testclass=
"Arguments"
testname=
"用户定义的变量"
enabled=
"true"
>
<collectionProp
name=
"Arguments.arguments"
/>
</elementProp>
...
...
@@ -210,7 +213,89 @@ vars.put("searchValue",req+"&client_secret="+md5Str);
<boolProp
name=
"resetInterpreter"
>
false
</boolProp>
<stringProp
name=
"script"
>
import java.security.MessageDigest;
String req =
"
app_version=5.8.0
&
client_type=test
&
decrease_number=1
&
method=app.Shopping.decrease
&
os_version=yohobuy:web
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku=
"
+bsh.args[2]+
"&
screen_size=720x1280
&
session_key=43aba1b5f35b3c978c4654bad2b638fa
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
String product_sku_list =
"
[{\
"
product_sku\
"
:
"
+bsh.args[2]+
"
,\
"
buy_number\
"
:1,\
"
promotion_id\
"
:0}]
"
;
String req =
"
app_version=5.8.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.removeAndQryCart
&
os_version=yohobuy:web
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=ee6f3430e10c933810a7bf78576bfb47
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
MessageDigest md = MessageDigest.getInstance(
"
MD5
"
);
byte[] btInput = req.getBytes();
md.update(btInput);
byte[] btResult = md.digest();
StringBuffer sb = new StringBuffer();
for(byte b : btResult){
int bt = b
&
0xff;
if(bt
<
16){
sb.append(0);
}
sb.append(Integer.toHexString(bt));
}
String md5code = sb.toString();
product_sku_list=URLEncoder.encode(product_sku_list);
req =
"
app_version=5.8.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.removeAndQryCart
&
os_version=yohobuy:web
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=ee6f3430e10c933810a7bf78576bfb47
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5code);
</stringProp>
</BeanShellPreProcessor>
<hashTree/>
<ResponseAssertion
guiclass=
"AssertionGui"
testclass=
"ResponseAssertion"
testname=
"响应断言"
enabled=
"true"
>
<collectionProp
name=
"Asserion.test_strings"
>
<stringProp
name=
"723337899"
>
"
code
"
:200
</stringProp>
</collectionProp>
<stringProp
name=
"Assertion.test_field"
>
Assertion.response_data
</stringProp>
<boolProp
name=
"Assertion.assume_success"
>
false
</boolProp>
<intProp
name=
"Assertion.test_type"
>
16
</intProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
<ConstantThroughputTimer
guiclass=
"TestBeanGUI"
testclass=
"ConstantThroughputTimer"
testname=
"Constant Throughput Timer"
enabled=
"true"
>
<intProp
name=
"calcMode"
>
2
</intProp>
<doubleProp>
<name>
throughput
</name>
<value>
150000.0
</value>
<savedValue>
0.0
</savedValue>
</doubleProp>
</ConstantThroughputTimer>
<hashTree/>
</hashTree>
<ThreadGroup
guiclass=
"ThreadGroupGui"
testclass=
"ThreadGroup"
testname=
"购物车-编辑inc"
enabled=
"true"
>
<stringProp
name=
"ThreadGroup.on_sample_error"
>
continue
</stringProp>
<elementProp
name=
"ThreadGroup.main_controller"
elementType=
"LoopController"
guiclass=
"LoopControlPanel"
testclass=
"LoopController"
testname=
"循环控制器"
enabled=
"true"
>
<boolProp
name=
"LoopController.continue_forever"
>
false
</boolProp>
<intProp
name=
"LoopController.loops"
>
-1
</intProp>
</elementProp>
<stringProp
name=
"ThreadGroup.num_threads"
>
50
</stringProp>
<stringProp
name=
"ThreadGroup.ramp_time"
>
10
</stringProp>
<longProp
name=
"ThreadGroup.start_time"
>
1501638755000
</longProp>
<longProp
name=
"ThreadGroup.end_time"
>
1501638755000
</longProp>
<boolProp
name=
"ThreadGroup.scheduler"
>
false
</boolProp>
<stringProp
name=
"ThreadGroup.duration"
></stringProp>
<stringProp
name=
"ThreadGroup.delay"
></stringProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_add"
enabled=
"true"
>
<elementProp
name=
"HTTPsampler.Arguments"
elementType=
"Arguments"
guiclass=
"HTTPArgumentsPanel"
testclass=
"Arguments"
testname=
"用户定义的变量"
enabled=
"true"
>
<collectionProp
name=
"Arguments.arguments"
/>
</elementProp>
<stringProp
name=
"HTTPSampler.domain"
></stringProp>
<stringProp
name=
"HTTPSampler.port"
></stringProp>
<stringProp
name=
"HTTPSampler.protocol"
></stringProp>
<stringProp
name=
"HTTPSampler.contentEncoding"
></stringProp>
<stringProp
name=
"HTTPSampler.path"
>
http://${HOST_API}/?${searchValue}
</stringProp>
<stringProp
name=
"HTTPSampler.method"
>
GET
</stringProp>
<boolProp
name=
"HTTPSampler.follow_redirects"
>
true
</boolProp>
<boolProp
name=
"HTTPSampler.auto_redirects"
>
false
</boolProp>
<boolProp
name=
"HTTPSampler.use_keepalive"
>
true
</boolProp>
<boolProp
name=
"HTTPSampler.DO_MULTIPART_POST"
>
false
</boolProp>
<stringProp
name=
"HTTPSampler.embedded_url_re"
></stringProp>
<stringProp
name=
"HTTPSampler.connect_timeout"
></stringProp>
<stringProp
name=
"HTTPSampler.response_timeout"
></stringProp>
</HTTPSamplerProxy>
<hashTree>
<BeanShellPreProcessor
guiclass=
"TestBeanGUI"
testclass=
"BeanShellPreProcessor"
testname=
"前置MD5"
enabled=
"true"
>
<stringProp
name=
"filename"
></stringProp>
<stringProp
name=
"parameters"
>
${uid_cart_edit} ${shopping_key_edit} ${sku_edit}
</stringProp>
<boolProp
name=
"resetInterpreter"
>
false
</boolProp>
<stringProp
name=
"script"
>
import java.security.MessageDigest;
String req =
"
app_version=5.8.0
&
buy_number=1
&
client_type=test
&
edit_product_sku=0
&
goods_type=0
&
method=app.Shopping.add
&
os_version=yohobuy:web
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku=
"
+bsh.args[2]+
"&
promotion_id=
&
screen_size=720x1280
&
selected=Y
&
session_key=5103fd2c7217459929865c1da6aa7f5a
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
MessageDigest md = MessageDigest.getInstance(
"
MD5
"
);
byte[] btInput = req.getBytes();
...
...
@@ -240,7 +325,7 @@ vars.put("searchValue",req+"&client_secret="+md5Str);
</ResponseAssertion>
<hashTree/>
</hashTree>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
selectedAndCart
"
enabled=
"true"
>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
increase
"
enabled=
"true"
>
<elementProp
name=
"HTTPsampler.Arguments"
elementType=
"Arguments"
guiclass=
"HTTPArgumentsPanel"
testclass=
"Arguments"
testname=
"用户定义的变量"
enabled=
"true"
>
<collectionProp
name=
"Arguments.arguments"
/>
</elementProp>
...
...
@@ -261,12 +346,11 @@ vars.put("searchValue",req+"&client_secret="+md5Str);
<hashTree>
<BeanShellPreProcessor
guiclass=
"TestBeanGUI"
testclass=
"BeanShellPreProcessor"
testname=
"前置MD5"
enabled=
"true"
>
<stringProp
name=
"filename"
></stringProp>
<stringProp
name=
"parameters"
>
${uid_cart_edit} ${shopping_key_edit} ${sku_edit}
${__RandomString(1,YN,)}
</stringProp>
<stringProp
name=
"parameters"
>
${uid_cart_edit} ${shopping_key_edit} ${sku_edit}
</stringProp>
<boolProp
name=
"resetInterpreter"
>
false
</boolProp>
<stringProp
name=
"script"
>
import java.security.MessageDigest;
String product_sku_list =
"
[{\
"
goods_type\
"
:\
"
ordinary\
"
,\
"
selected\
"
:\
""
+bsh.args[3]+
"
\
"
,\
"
product_sku\
"
:
"
+bsh.args[2]+
"
,\
"
promotion_id\
"
:\
"
\
"
,\
"
buy_number\
"
:\
"
1\
"
}]
"
;
String req =
"
app_version=5.9.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.selectedAndQryCart
&
os_version=yohobuy:h5
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=00ed65eb36a474388df2fa2d6e97a8a5
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
String req =
"
app_version=5.8.1
&
client_type=test
&
fromPage=aFP_ShopCart
&
gender=1,3
&
increase_number=1
&
method=app.Shopping.increase
&
os_version=android4.3:R6007
&
physical_channel=1
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku=
"
+bsh.args[2]+
"&
screen_size=720x1280
&
session_key=b8587bfb19e123bb56d3dabf1a5a80f7
&
shopping_key=
"
+bsh.args[1]+
"&
udid=865852023421405a11b22ab89b6adb8
&
uid=
"
+bsh.args[0]+
"&
v=7
&
yh_channel=1
"
;
MessageDigest md = MessageDigest.getInstance(
"
MD5
"
);
byte[] btInput = req.getBytes();
...
...
@@ -281,10 +365,8 @@ for(byte b : btResult){
}
sb.append(Integer.toHexString(bt));
}
String md5code = sb.toString();
product_sku_list=URLEncoder.encode(product_sku_list);
req =
"
app_version=5.9.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.selectedAndQryCart
&
os_version=yohobuy:h5
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=00ed65eb36a474388df2fa2d6e97a8a5
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5code);
String md5Str = sb.toString();
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5Str);
</stringProp>
</BeanShellPreProcessor>
<hashTree/>
...
...
@@ -298,7 +380,7 @@ vars.put("searchValue",req+"&client_secret="+md5code);
</ResponseAssertion>
<hashTree/>
</hashTree>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
removeAndCart
"
enabled=
"true"
>
<HTTPSamplerProxy
guiclass=
"HttpTestSampleGui"
testclass=
"HTTPSamplerProxy"
testname=
"tc_app_Shopping_
decrease
"
enabled=
"true"
>
<elementProp
name=
"HTTPsampler.Arguments"
elementType=
"Arguments"
guiclass=
"HTTPArgumentsPanel"
testclass=
"Arguments"
testname=
"用户定义的变量"
enabled=
"true"
>
<collectionProp
name=
"Arguments.arguments"
/>
</elementProp>
...
...
@@ -323,8 +405,7 @@ vars.put("searchValue",req+"&client_secret="+md5code);
<boolProp
name=
"resetInterpreter"
>
false
</boolProp>
<stringProp
name=
"script"
>
import java.security.MessageDigest;
String product_sku_list =
"
[{\
"
product_sku\
"
:
"
+bsh.args[2]+
"
,\
"
buy_number\
"
:1,\
"
promotion_id\
"
:0}]
"
;
String req =
"
app_version=5.8.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.removeAndQryCart
&
os_version=yohobuy:web
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=ee6f3430e10c933810a7bf78576bfb47
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
String req =
"
app_version=5.8.0
&
client_type=test
&
decrease_number=1
&
method=app.Shopping.decrease
&
os_version=yohobuy:web
&
private_key=fd4ad5fcfa0de589ef238c0e7331b585
&
product_sku=
"
+bsh.args[2]+
"&
screen_size=720x1280
&
session_key=43aba1b5f35b3c978c4654bad2b638fa
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
MessageDigest md = MessageDigest.getInstance(
"
MD5
"
);
byte[] btInput = req.getBytes();
...
...
@@ -339,10 +420,9 @@ for(byte b : btResult){
}
sb.append(Integer.toHexString(bt));
}
String md5code = sb.toString();
product_sku_list=URLEncoder.encode(product_sku_list);
req =
"
app_version=5.8.0
&
client_type=test
&
is_support_mlp=Y
&
method=app.Shopping.removeAndQryCart
&
os_version=yohobuy:web
&
product_sku_list=
"
+product_sku_list+
"&
screen_size=720x1280
&
session_key=ee6f3430e10c933810a7bf78576bfb47
&
shopping_key=
"
+bsh.args[1]+
"&
uid=
"
+bsh.args[0]+
"&
v=7
"
;
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5code);
</stringProp>
String md5Str = sb.toString();
vars.put(
"
searchValue
"
,req+
"&
client_secret=
"
+md5Str);
</stringProp>
</BeanShellPreProcessor>
<hashTree/>
<ResponseAssertion
guiclass=
"AssertionGui"
testclass=
"ResponseAssertion"
testname=
"响应断言"
enabled=
"true"
>
...
...
@@ -359,7 +439,7 @@ vars.put("searchValue",req+"&client_secret="+md5code);</
<intProp
name=
"calcMode"
>
2
</intProp>
<doubleProp>
<name>
throughput
</name>
<value>
1
500
00.0
</value>
<value>
1
8
00.0
</value>
<savedValue>
0.0
</savedValue>
</doubleProp>
</ConstantThroughputTimer>
...
...
Please
register
or
login
to post a comment