Showing
1 changed file
with
21 additions
and
1335 deletions
@@ -22,6 +22,16 @@ | @@ -22,6 +22,16 @@ | ||
22 | </collectionProp> | 22 | </collectionProp> |
23 | <stringProp name="TestPlan.comments">通用session校验码</stringProp> </Arguments> | 23 | <stringProp name="TestPlan.comments">通用session校验码</stringProp> </Arguments> |
24 | <hashTree/> | 24 | <hashTree/> |
25 | + <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="arguments_TMP" enabled="true"> | ||
26 | + <collectionProp name="Arguments.arguments"> | ||
27 | + <elementProp name="HOST_API" elementType="Argument"> | ||
28 | + <stringProp name="Argument.name">HOST_API</stringProp> | ||
29 | + <stringProp name="Argument.value">api-test3.yohops.com:9999</stringProp> | ||
30 | + <stringProp name="Argument.metadata">=</stringProp> | ||
31 | + </elementProp> | ||
32 | + </collectionProp> | ||
33 | + <stringProp name="TestPlan.comments"></stringProp> </Arguments> | ||
34 | + <hashTree/> | ||
25 | <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_10w" enabled="true"> | 35 | <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_10w" enabled="true"> |
26 | <stringProp name="TestPlan.comments"></stringProp> | 36 | <stringProp name="TestPlan.comments"></stringProp> |
27 | <stringProp name="filename">/opt/jmeter/data/uid_mobile_openid.csv</stringProp> | 37 | <stringProp name="filename">/opt/jmeter/data/uid_mobile_openid.csv</stringProp> |
@@ -34,167 +44,23 @@ | @@ -34,167 +44,23 @@ | ||
34 | <stringProp name="shareMode">shareMode.all</stringProp> | 44 | <stringProp name="shareMode">shareMode.all</stringProp> |
35 | </CSVDataSet> | 45 | </CSVDataSet> |
36 | <hashTree/> | 46 | <hashTree/> |
37 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_hosts_pt" enabled="true"> | ||
38 | - <stringProp name="TestPlan.comments"></stringProp> | ||
39 | - <stringProp name="filename">/opt/jmeter/data/hosts_pt.csv</stringProp> | ||
40 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
41 | - <stringProp name="variableNames">HOST_API,HOST_SERVICE</stringProp> | ||
42 | - <stringProp name="delimiter">,</stringProp> | ||
43 | - <boolProp name="quotedData">false</boolProp> | ||
44 | - <boolProp name="recycle">true</boolProp> | ||
45 | - <boolProp name="stopThread">false</boolProp> | ||
46 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
47 | - </CSVDataSet> | ||
48 | - <hashTree/> | ||
49 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_商品for浏览" enabled="true"> | ||
50 | - <stringProp name="TestPlan.comments"></stringProp> | ||
51 | - <stringProp name="filename">/opt/jmeter/data/product_2w.csv</stringProp> | ||
52 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
53 | - <stringProp name="variableNames">product_id,product_skn</stringProp> | ||
54 | - <stringProp name="delimiter">,</stringProp> | ||
55 | - <boolProp name="quotedData">false</boolProp> | ||
56 | - <boolProp name="recycle">true</boolProp> | ||
57 | - <boolProp name="stopThread">false</boolProp> | ||
58 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
59 | - </CSVDataSet> | ||
60 | - <hashTree/> | ||
61 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_品牌数据" enabled="true"> | ||
62 | - <stringProp name="TestPlan.comments">品牌数据</stringProp> | ||
63 | - <stringProp name="filename">/opt/jmeter/data/brand.csv</stringProp> | ||
64 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
65 | - <stringProp name="variableNames">brand_id</stringProp> | ||
66 | - <stringProp name="delimiter">,</stringProp> | ||
67 | - <boolProp name="quotedData">false</boolProp> | ||
68 | - <boolProp name="recycle">true</boolProp> | ||
69 | - <boolProp name="stopThread">false</boolProp> | ||
70 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
71 | - </CSVDataSet> | ||
72 | - <hashTree/> | ||
73 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_购物车查询" enabled="true"> | ||
74 | - <stringProp name="TestPlan.comments"></stringProp> | ||
75 | - <stringProp name="filename">/opt/jmeter/data/cart_query.csv</stringProp> | ||
76 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
77 | - <stringProp name="variableNames">cart_uid,cart_shopping_key,unuser_promotion_id</stringProp> | ||
78 | - <stringProp name="delimiter">,</stringProp> | ||
79 | - <boolProp name="quotedData">false</boolProp> | ||
80 | - <boolProp name="recycle">true</boolProp> | ||
81 | - <boolProp name="stopThread">false</boolProp> | ||
82 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
83 | - </CSVDataSet> | ||
84 | - <hashTree/> | ||
85 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_逛" enabled="true"> | ||
86 | - <stringProp name="TestPlan.comments"></stringProp> | ||
87 | - <stringProp name="filename">/opt/jmeter/data/guang.csv</stringProp> | ||
88 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
89 | - <stringProp name="variableNames">article_id,article_author_id,article_datetime</stringProp> | ||
90 | - <stringProp name="delimiter">,</stringProp> | ||
91 | - <boolProp name="quotedData">false</boolProp> | ||
92 | - <boolProp name="recycle">true</boolProp> | ||
93 | - <boolProp name="stopThread">false</boolProp> | ||
94 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
95 | - </CSVDataSet> | ||
96 | - <hashTree/> | ||
97 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_订单" enabled="true"> | ||
98 | - <stringProp name="TestPlan.comments"></stringProp> | ||
99 | - <stringProp name="filename">/opt/jmeter/data/order_code.csv</stringProp> | ||
100 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
101 | - <stringProp name="variableNames">order_code,order_uid</stringProp> | ||
102 | - <stringProp name="delimiter">,</stringProp> | ||
103 | - <boolProp name="quotedData">false</boolProp> | ||
104 | - <boolProp name="recycle">true</boolProp> | ||
105 | - <boolProp name="stopThread">false</boolProp> | ||
106 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
107 | - </CSVDataSet> | ||
108 | - <hashTree/> | ||
109 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_cart_edit_5k_2" enabled="true"> | ||
110 | - <stringProp name="TestPlan.comments"></stringProp> | ||
111 | - <stringProp name="filename">/opt/jmeter/data/uid_cart_edit.csv</stringProp> | ||
112 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
113 | - <stringProp name="variableNames">uid,address_id_edit,shopping_key_edit,coupon_code_1_edit,coupon_code_2_edit</stringProp> | ||
114 | - <stringProp name="delimiter">,</stringProp> | ||
115 | - <boolProp name="quotedData">false</boolProp> | ||
116 | - <boolProp name="recycle">true</boolProp> | ||
117 | - <boolProp name="stopThread">false</boolProp> | ||
118 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
119 | - </CSVDataSet> | ||
120 | - <hashTree/> | ||
121 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_品牌关联" enabled="true"> | ||
122 | - <stringProp name="TestPlan.comments"></stringProp> | ||
123 | - <stringProp name="filename">/opt/jmeter/data/brandRelation.csv</stringProp> | ||
124 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
125 | - <stringProp name="variableNames">brandRelationId</stringProp> | ||
126 | - <stringProp name="delimiter">,</stringProp> | ||
127 | - <boolProp name="quotedData">false</boolProp> | ||
128 | - <boolProp name="recycle">true</boolProp> | ||
129 | - <boolProp name="stopThread">false</boolProp> | ||
130 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
131 | - </CSVDataSet> | ||
132 | - <hashTree/> | ||
133 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_促销id" enabled="true"> | ||
134 | - <stringProp name="TestPlan.comments"></stringProp> | ||
135 | - <stringProp name="filename">/opt/jmeter/data/promotion_id.csv</stringProp> | ||
136 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
137 | - <stringProp name="variableNames">cart_promotion_id</stringProp> | ||
138 | - <stringProp name="delimiter">,</stringProp> | ||
139 | - <boolProp name="quotedData">false</boolProp> | ||
140 | - <boolProp name="recycle">true</boolProp> | ||
141 | - <boolProp name="stopThread">false</boolProp> | ||
142 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
143 | - </CSVDataSet> | ||
144 | - <hashTree/> | ||
145 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_test_1w" enabled="true"> | ||
146 | - <stringProp name="TestPlan.comments"></stringProp> | ||
147 | - <stringProp name="filename">/opt/jmeter/data/uid_mobile_openid_test.csv</stringProp> | ||
148 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
149 | - <stringProp name="variableNames">uid_test,mobile_test,open_id_test</stringProp> | ||
150 | - <stringProp name="delimiter">,</stringProp> | ||
151 | - <boolProp name="quotedData">false</boolProp> | ||
152 | - <boolProp name="recycle">true</boolProp> | ||
153 | - <boolProp name="stopThread">false</boolProp> | ||
154 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
155 | - </CSVDataSet> | ||
156 | - <hashTree/> | ||
157 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_sku_edit_25w" enabled="true"> | ||
158 | - <stringProp name="TestPlan.comments"></stringProp> | ||
159 | - <stringProp name="filename">/opt/jmeter/data/uid_sku_edit.csv</stringProp> | ||
160 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
161 | - <stringProp name="variableNames">uid_edit,address_id_edit,coupon_code_edit,sku_edit</stringProp> | ||
162 | - <stringProp name="delimiter">,</stringProp> | ||
163 | - <boolProp name="quotedData">false</boolProp> | ||
164 | - <boolProp name="recycle">true</boolProp> | ||
165 | - <boolProp name="stopThread">false</boolProp> | ||
166 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
167 | - </CSVDataSet> | ||
168 | - <hashTree/> | ||
169 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_sku_submit_25w" enabled="true"> | ||
170 | - <stringProp name="TestPlan.comments"></stringProp> | ||
171 | - <stringProp name="filename">/opt/jmeter/data/uid_sku_submit.csv</stringProp> | ||
172 | - <stringProp name="fileEncoding">utf-8</stringProp> | ||
173 | - <stringProp name="variableNames">uid_submit,address_id_submit,coupon_code_submit,sku_submit</stringProp> | ||
174 | - <stringProp name="delimiter">,</stringProp> | ||
175 | - <boolProp name="quotedData">false</boolProp> | ||
176 | - <boolProp name="recycle">true</boolProp> | ||
177 | - <boolProp name="stopThread">false</boolProp> | ||
178 | - <stringProp name="shareMode">shareMode.all</stringProp> | ||
179 | - </CSVDataSet> | ||
180 | - <hashTree/> | ||
181 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_queryCart" enabled="true"> | 47 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_drawline_addQueue" enabled="true"> |
182 | <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | 48 | <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> |
183 | <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | 49 | <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> |
184 | <boolProp name="LoopController.continue_forever">false</boolProp> | 50 | <boolProp name="LoopController.continue_forever">false</boolProp> |
185 | <intProp name="LoopController.loops">-1</intProp> | 51 | <intProp name="LoopController.loops">-1</intProp> |
186 | </elementProp> | 52 | </elementProp> |
187 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | 53 | + <stringProp name="ThreadGroup.num_threads">10</stringProp> |
188 | <stringProp name="ThreadGroup.ramp_time">10</stringProp> | 54 | <stringProp name="ThreadGroup.ramp_time">10</stringProp> |
189 | <longProp name="ThreadGroup.start_time">1488865571000</longProp> | 55 | <longProp name="ThreadGroup.start_time">1488865571000</longProp> |
190 | <longProp name="ThreadGroup.end_time">1488865571000</longProp> | 56 | <longProp name="ThreadGroup.end_time">1488865571000</longProp> |
191 | <boolProp name="ThreadGroup.scheduler">false</boolProp> | 57 | <boolProp name="ThreadGroup.scheduler">false</boolProp> |
192 | <stringProp name="ThreadGroup.duration"></stringProp> | 58 | <stringProp name="ThreadGroup.duration"></stringProp> |
193 | <stringProp name="ThreadGroup.delay"></stringProp> | 59 | <stringProp name="ThreadGroup.delay"></stringProp> |
194 | - <stringProp name="TestPlan.comments">查询用户购物车</stringProp> | 60 | + <stringProp name="TestPlan.comments"></stringProp> |
195 | </ThreadGroup> | 61 | </ThreadGroup> |
196 | <hashTree> | 62 | <hashTree> |
197 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_queryCart" enabled="true"> | 63 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_drawline_addQueue" enabled="true"> |
198 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | 64 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> |
199 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | 65 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> |
200 | <collectionProp name="Arguments.arguments"> | 66 | <collectionProp name="Arguments.arguments"> |
@@ -219,121 +85,23 @@ | @@ -219,121 +85,23 @@ | ||
219 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | 85 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> |
220 | <boolProp name="HTTPSampler.monitor">false</boolProp> | 86 | <boolProp name="HTTPSampler.monitor">false</boolProp> |
221 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | 87 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> |
222 | - <stringProp name="TestPlan.comments">查询用户购物车</stringProp> | ||
223 | - </HTTPSamplerProxy> | ||
224 | - <hashTree> | ||
225 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
226 | - <stringProp name="TestPlan.comments"></stringProp> | ||
227 | - <boolProp name="resetInterpreter">false</boolProp> | ||
228 | - <stringProp name="parameters">${SNCP} ${cart_uid}</stringProp> | ||
229 | - <stringProp name="filename"></stringProp> | ||
230 | - <stringProp name="script">import java.security.MessageDigest; | ||
231 | -import java.util.Random; | ||
232 | -String[] clientTypes = {"android"}; | ||
233 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"}; | ||
234 | -int rd = new Random().nextInt(1); | ||
235 | -String clientType = clientTypes[rd]; | ||
236 | -String privateKey = privateKeys[rd]; | ||
237 | -String os_version = "yohobuy:web"; | ||
238 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.queryCart&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=3b3af315f8ee63ba511d596496dabd39&shopping_key=0&uid="+bsh.args[1]+"&v=7"; | ||
239 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
240 | -byte[] btInput = req.getBytes(); | ||
241 | -md.update(btInput); | ||
242 | -byte[] btResult = md.digest(); | ||
243 | -StringBuffer sb = new StringBuffer(); | ||
244 | -for(byte b : btResult){ | ||
245 | - int bt = b&0xff; | ||
246 | - if(bt<16){ | ||
247 | - sb.append(0); | ||
248 | - } | ||
249 | - sb.append(Integer.toHexString(bt)); | ||
250 | -} | ||
251 | -String md5 = sb.toString(); | ||
252 | -os_version=URLEncoder.encode(os_version); | ||
253 | -req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.queryCart&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=3b3af315f8ee63ba511d596496dabd39&shopping_key=0&uid="+bsh.args[1]+"&v=7"; | ||
254 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
255 | - </BeanShellPreProcessor> | ||
256 | - <hashTree/> | ||
257 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
258 | - <collectionProp name="Asserion.test_strings"> | ||
259 | - <stringProp name="1450572480">"code":200</stringProp> | ||
260 | - </collectionProp> | ||
261 | - <stringProp name="TestPlan.comments"></stringProp> | ||
262 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
263 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
264 | - <intProp name="Assertion.test_type">16</intProp> | ||
265 | - </ResponseAssertion> | ||
266 | - <hashTree/> | ||
267 | - </hashTree> | ||
268 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
269 | <stringProp name="TestPlan.comments"></stringProp> | 88 | <stringProp name="TestPlan.comments"></stringProp> |
270 | - <doubleProp> | ||
271 | - <name>throughput</name> | ||
272 | - <value>600</value> | ||
273 | - <savedValue>0.0</savedValue> | ||
274 | - </doubleProp> | ||
275 | - <intProp name="calcMode">2</intProp> | ||
276 | - </ConstantThroughputTimer> | ||
277 | - <hashTree/> | ||
278 | - </hashTree> | ||
279 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_queryPromotionGifts" enabled="true"> | ||
280 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
281 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
282 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
283 | - <intProp name="LoopController.loops">-1</intProp> | ||
284 | - </elementProp> | ||
285 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
286 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
287 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
288 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
289 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
290 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
291 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
292 | - <stringProp name="TestPlan.comments">加价购促销商品列表</stringProp> | ||
293 | - </ThreadGroup> | ||
294 | - <hashTree> | ||
295 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_queryPromotionGifts" enabled="true"> | ||
296 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
297 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
298 | - <collectionProp name="Arguments.arguments"> | ||
299 | - <elementProp name="" elementType="HTTPArgument"> | ||
300 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
301 | - <stringProp name="Argument.value"></stringProp> | ||
302 | - <stringProp name="Argument.metadata">=</stringProp> | ||
303 | - </elementProp> | ||
304 | - </collectionProp> | ||
305 | - </elementProp> | ||
306 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
307 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
308 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
309 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
310 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
311 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
312 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
313 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
314 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
315 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
316 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
317 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
318 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
319 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
320 | - <stringProp name="TestPlan.comments">加价购促销商品列表</stringProp> | ||
321 | </HTTPSamplerProxy> | 89 | </HTTPSamplerProxy> |
322 | <hashTree> | 90 | <hashTree> |
323 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | 91 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> |
324 | <stringProp name="TestPlan.comments"></stringProp> | 92 | <stringProp name="TestPlan.comments"></stringProp> |
325 | <boolProp name="resetInterpreter">false</boolProp> | 93 | <boolProp name="resetInterpreter">false</boolProp> |
326 | - <stringProp name="parameters">${SNCP} ${cart_promotion_id} ${cart_uid}</stringProp> | 94 | + <stringProp name="parameters">${uid}</stringProp> |
327 | <stringProp name="filename"></stringProp> | 95 | <stringProp name="filename"></stringProp> |
328 | <stringProp name="script">import java.security.MessageDigest; | 96 | <stringProp name="script">import java.security.MessageDigest; |
329 | import java.util.Random; | 97 | import java.util.Random; |
330 | -String[] clientTypes = {"android"}; | ||
331 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"}; | ||
332 | -int rd = new Random().nextInt(1); | 98 | +String[] clientTypes = {"android","iphone"}; |
99 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
100 | +int rd = new Random().nextInt(2); | ||
333 | String clientType = clientTypes[rd]; | 101 | String clientType = clientTypes[rd]; |
334 | String privateKey = privateKeys[rd]; | 102 | String privateKey = privateKeys[rd]; |
335 | -String os_version = "android5.1:HUAWEI_TAG-TL00"; | ||
336 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&gender=1,3&method=app.Shopping.queryPromotionGifts&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&promotion_ids="+bsh.args[1]+"&screen_size=720x1184&session_key=266c935f31d983be4e7a53c860a0aa08&udid=8607740395271396b56710412cb59c1&uid="+bsh.args[2]+"&v=7&yh_channel=1"; | 103 | +String os_version = "android6.0.1:MI_4LTE"; |
104 | +String req = "activityId=384&app_version=6.7.0&business_line=yohobuy&client_type="+clientType+"&fromPage=aFP_Queue&gender=1,3&method=app.drawline.addQueue&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1920&session_key=eda4ab2daa1ea85bcd4ef79ce9ccbe2f&udid=866899023021106371c7743458299a6&uid="+bsh.args[0]+"&v=7&vip_level=0&yh_channel=1"; | ||
337 | MessageDigest md = MessageDigest.getInstance("MD5"); | 105 | MessageDigest md = MessageDigest.getInstance("MD5"); |
338 | byte[] btInput = req.getBytes(); | 106 | byte[] btInput = req.getBytes(); |
339 | md.update(btInput); | 107 | md.update(btInput); |
@@ -348,1089 +116,7 @@ for(byte b : btResult){ | @@ -348,1089 +116,7 @@ for(byte b : btResult){ | ||
348 | } | 116 | } |
349 | String md5 = sb.toString(); | 117 | String md5 = sb.toString(); |
350 | os_version=URLEncoder.encode(os_version); | 118 | os_version=URLEncoder.encode(os_version); |
351 | -req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&gender=1,3&method=app.Shopping.queryPromotionGifts&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&promotion_ids="+bsh.args[1]+"&screen_size=720x1184&session_key=266c935f31d983be4e7a53c860a0aa08&udid=8607740395271396b56710412cb59c1&uid="+bsh.args[2]+"&v=7&yh_channel=1"; | ||
352 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
353 | - </BeanShellPreProcessor> | ||
354 | - <hashTree/> | ||
355 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
356 | - <collectionProp name="Asserion.test_strings"> | ||
357 | - <stringProp name="1450572480">"code":200</stringProp> | ||
358 | - </collectionProp> | ||
359 | - <stringProp name="TestPlan.comments"></stringProp> | ||
360 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
361 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
362 | - <intProp name="Assertion.test_type">16</intProp> | ||
363 | - </ResponseAssertion> | ||
364 | - <hashTree/> | ||
365 | - </hashTree> | ||
366 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
367 | - <stringProp name="TestPlan.comments"></stringProp> | ||
368 | - <doubleProp> | ||
369 | - <name>throughput</name> | ||
370 | - <value>600</value> | ||
371 | - <savedValue>0.0</savedValue> | ||
372 | - </doubleProp> | ||
373 | - <intProp name="calcMode">2</intProp> | ||
374 | - </ConstantThroughputTimer> | ||
375 | - <hashTree/> | ||
376 | - </hashTree> | ||
377 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_add_edit" enabled="true"> | ||
378 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
379 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
380 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
381 | - <intProp name="LoopController.loops">-1</intProp> | ||
382 | - </elementProp> | ||
383 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
384 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
385 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
386 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
387 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
388 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
389 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
390 | - <stringProp name="TestPlan.comments">添加购物车</stringProp> | ||
391 | - </ThreadGroup> | ||
392 | - <hashTree> | ||
393 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_add_edit" enabled="true"> | ||
394 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
395 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
396 | - <collectionProp name="Arguments.arguments"> | ||
397 | - <elementProp name="" elementType="HTTPArgument"> | ||
398 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
399 | - <stringProp name="Argument.value"></stringProp> | ||
400 | - <stringProp name="Argument.metadata">=</stringProp> | ||
401 | - </elementProp> | ||
402 | - </collectionProp> | ||
403 | - </elementProp> | ||
404 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
405 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
406 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
407 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
408 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
409 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
410 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
411 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
412 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
413 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
414 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
415 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
416 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
417 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
418 | - <stringProp name="TestPlan.comments">添加购物车</stringProp> | ||
419 | - </HTTPSamplerProxy> | ||
420 | - <hashTree> | ||
421 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
422 | - <stringProp name="TestPlan.comments"></stringProp> | ||
423 | - <boolProp name="resetInterpreter">false</boolProp> | ||
424 | - <stringProp name="parameters">${SNCP} ${sku_edit} ${uid_edit}</stringProp> | ||
425 | - <stringProp name="filename"></stringProp> | ||
426 | - <stringProp name="script">import java.security.MessageDigest; | ||
427 | -import java.util.Random; | ||
428 | -String[] clientTypes = {"android","iphone"}; | ||
429 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
430 | -int rd = new Random().nextInt(2); | ||
431 | -String clientType = clientTypes[rd]; | ||
432 | -String privateKey = privateKeys[rd]; | ||
433 | -String os_version = "yohobuy:web"; | ||
434 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&buy_number=1&client_type="+clientType+"&edit_product_sku=0&goods_type=0&method=app.Shopping.add&os_version="+os_version+"&private_key="+privateKey+"&product_sku="+bsh.args[1]+"&promotion_id=&screen_size=720x1280&selected=Y&session_key=5103fd2c7217459929865c1da6aa7f5a&shopping_key=0&uid="+bsh.args[2]+"&v=7"; | ||
435 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
436 | -byte[] btInput = req.getBytes(); | ||
437 | -md.update(btInput); | ||
438 | -byte[] btResult = md.digest(); | ||
439 | -StringBuffer sb = new StringBuffer(); | ||
440 | -for(byte b : btResult){ | ||
441 | - int bt = b&0xff; | ||
442 | - if(bt<16){ | ||
443 | - sb.append(0); | ||
444 | - } | ||
445 | - sb.append(Integer.toHexString(bt)); | ||
446 | -} | ||
447 | -String md5 = sb.toString(); | ||
448 | -os_version=URLEncoder.encode(os_version); | ||
449 | -req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&buy_number=1&client_type="+clientType+"&edit_product_sku=0&goods_type=0&method=app.Shopping.add&os_version="+os_version+"&private_key="+privateKey+"&product_sku="+bsh.args[1]+"&promotion_id=&screen_size=720x1280&selected=Y&session_key=5103fd2c7217459929865c1da6aa7f5a&shopping_key=0&uid="+bsh.args[2]+"&v=7"; | ||
450 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
451 | - </BeanShellPreProcessor> | ||
452 | - <hashTree/> | ||
453 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
454 | - <collectionProp name="Asserion.test_strings"> | ||
455 | - <stringProp name="1450572480">"code":200</stringProp> | ||
456 | - </collectionProp> | ||
457 | - <stringProp name="TestPlan.comments"></stringProp> | ||
458 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
459 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
460 | - <intProp name="Assertion.test_type">16</intProp> | ||
461 | - </ResponseAssertion> | ||
462 | - <hashTree/> | ||
463 | - </hashTree> | ||
464 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
465 | - <stringProp name="TestPlan.comments"></stringProp> | ||
466 | - <doubleProp> | ||
467 | - <name>throughput</name> | ||
468 | - <value>600</value> | ||
469 | - <savedValue>0.0</savedValue> | ||
470 | - </doubleProp> | ||
471 | - <intProp name="calcMode">2</intProp> | ||
472 | - </ConstantThroughputTimer> | ||
473 | - <hashTree/> | ||
474 | - </hashTree> | ||
475 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_removeAndQryCart" enabled="true"> | ||
476 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
477 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
478 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
479 | - <intProp name="LoopController.loops">-1</intProp> | ||
480 | - </elementProp> | ||
481 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
482 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
483 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
484 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
485 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
486 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
487 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
488 | - <stringProp name="TestPlan.comments">删除并查询购物车</stringProp> | ||
489 | - </ThreadGroup> | ||
490 | - <hashTree> | ||
491 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_removeAndQryCart" enabled="true"> | ||
492 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
493 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
494 | - <collectionProp name="Arguments.arguments"> | ||
495 | - <elementProp name="" elementType="HTTPArgument"> | ||
496 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
497 | - <stringProp name="Argument.value"></stringProp> | ||
498 | - <stringProp name="Argument.metadata">=</stringProp> | ||
499 | - </elementProp> | ||
500 | - </collectionProp> | ||
501 | - </elementProp> | ||
502 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
503 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
504 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
505 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
506 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
507 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
508 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
509 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
510 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
511 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
512 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
513 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
514 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
515 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
516 | - <stringProp name="TestPlan.comments">删除并查询购物车</stringProp> | ||
517 | - </HTTPSamplerProxy> | ||
518 | - <hashTree> | ||
519 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
520 | - <stringProp name="TestPlan.comments"></stringProp> | ||
521 | - <boolProp name="resetInterpreter">false</boolProp> | ||
522 | - <stringProp name="parameters">${SNCP} ${sku_edit} ${uid_edit}</stringProp> | ||
523 | - <stringProp name="filename"></stringProp> | ||
524 | - <stringProp name="script">import java.security.MessageDigest; | ||
525 | -import java.util.Random; | ||
526 | -String[] clientTypes = {"android","iphone"}; | ||
527 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
528 | -int rd = new Random().nextInt(2); | ||
529 | -String clientType = clientTypes[rd]; | ||
530 | -String privateKey = privateKeys[rd]; | ||
531 | -String os_version = "yohobuy:web"; | ||
532 | -String product_sku_list = "[{\"product_sku\":"+bsh.args[1]+",\"buy_number\":1,\"promotion_id\":0}]"; | ||
533 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.removeAndQryCart&os_version="+os_version+"&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=ee6f3430e10c933810a7bf78576bfb47&shopping_key=0&uid="+bsh.args[2]+"&v=7"; | ||
534 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
535 | -byte[] btInput = req.getBytes(); | ||
536 | -md.update(btInput); | ||
537 | -byte[] btResult = md.digest(); | ||
538 | -StringBuffer sb = new StringBuffer(); | ||
539 | -for(byte b : btResult){ | ||
540 | - int bt = b&0xff; | ||
541 | - if(bt<16){ | ||
542 | - sb.append(0); | ||
543 | - } | ||
544 | - sb.append(Integer.toHexString(bt)); | ||
545 | -} | ||
546 | -String md5 = sb.toString(); | ||
547 | -os_version=URLEncoder.encode(os_version); | ||
548 | -product_sku_list=URLEncoder.encode(product_sku_list); | ||
549 | -req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.removeAndQryCart&os_version="+os_version+"&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=ee6f3430e10c933810a7bf78576bfb47&shopping_key=0&uid="+bsh.args[2]+"&v=7"; | ||
550 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
551 | - </BeanShellPreProcessor> | ||
552 | - <hashTree/> | ||
553 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
554 | - <collectionProp name="Asserion.test_strings"> | ||
555 | - <stringProp name="1450572480">"code":200</stringProp> | ||
556 | - </collectionProp> | ||
557 | - <stringProp name="TestPlan.comments"></stringProp> | ||
558 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
559 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
560 | - <intProp name="Assertion.test_type">16</intProp> | ||
561 | - </ResponseAssertion> | ||
562 | - <hashTree/> | ||
563 | - </hashTree> | ||
564 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
565 | - <stringProp name="TestPlan.comments"></stringProp> | ||
566 | - <doubleProp> | ||
567 | - <name>throughput</name> | ||
568 | - <value>600</value> | ||
569 | - <savedValue>0.0</savedValue> | ||
570 | - </doubleProp> | ||
571 | - <intProp name="calcMode">2</intProp> | ||
572 | - </ConstantThroughputTimer> | ||
573 | - <hashTree/> | ||
574 | - </hashTree> | ||
575 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_selectedAndQryCart_single" enabled="true"> | ||
576 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
577 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
578 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
579 | - <intProp name="LoopController.loops">-1</intProp> | ||
580 | - </elementProp> | ||
581 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
582 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
583 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
584 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
585 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
586 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
587 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
588 | - <stringProp name="TestPlan.comments"></stringProp> | ||
589 | - </ThreadGroup> | ||
590 | - <hashTree> | ||
591 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_selectedAndQryCart_single" enabled="true"> | ||
592 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
593 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
594 | - <collectionProp name="Arguments.arguments"> | ||
595 | - <elementProp name="" elementType="HTTPArgument"> | ||
596 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
597 | - <stringProp name="Argument.value"></stringProp> | ||
598 | - <stringProp name="Argument.metadata">=</stringProp> | ||
599 | - </elementProp> | ||
600 | - </collectionProp> | ||
601 | - </elementProp> | ||
602 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
603 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
604 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
605 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
606 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
607 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
608 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
609 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
610 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
611 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
612 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
613 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
614 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
615 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
616 | - <stringProp name="TestPlan.comments"></stringProp> | ||
617 | - </HTTPSamplerProxy> | ||
618 | - <hashTree> | ||
619 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
620 | - <stringProp name="TestPlan.comments"></stringProp> | ||
621 | - <boolProp name="resetInterpreter">false</boolProp> | ||
622 | - <stringProp name="parameters">${SNCP} ${__RandomString(1,YN,)} ${sku_edit} ${uid_edit}</stringProp> | ||
623 | - <stringProp name="filename"></stringProp> | ||
624 | - <stringProp name="script">import java.security.MessageDigest; | ||
625 | -import java.util.Random; | ||
626 | -String[] clientTypes = {"android","iphone"}; | ||
627 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
628 | -int rd = new Random().nextInt(2); | ||
629 | -String clientType = clientTypes[rd]; | ||
630 | -String privateKey = privateKeys[rd]; | ||
631 | -String os_version = "yohobuy:h5"; | ||
632 | -String product_sku_list = "[{\"goods_type\":\"ordinary\",\"selected\":\""+bsh.args[1]+"\",\"product_sku\":"+bsh.args[2]+",\"promotion_id\":\"\",\"buy_number\":\"1\"}]"; | ||
633 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.selectedAndQryCart&os_version="+os_version+"&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&shopping_key=73f21814e488a48fc0204d780cea2302&uid="+bsh.args[3]+"&v=7"; | ||
634 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
635 | -byte[] btInput = req.getBytes(); | ||
636 | -md.update(btInput); | ||
637 | -byte[] btResult = md.digest(); | ||
638 | -StringBuffer sb = new StringBuffer(); | ||
639 | -for(byte b : btResult){ | ||
640 | - int bt = b&0xff; | ||
641 | - if(bt<16){ | ||
642 | - sb.append(0); | ||
643 | - } | ||
644 | - sb.append(Integer.toHexString(bt)); | ||
645 | -} | ||
646 | -String md5 = sb.toString(); | ||
647 | -os_version=URLEncoder.encode(os_version); | ||
648 | -product_sku_list=URLEncoder.encode(product_sku_list); | ||
649 | -req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.selectedAndQryCart&os_version="+os_version+"&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&shopping_key=73f21814e488a48fc0204d780cea2302&uid="+bsh.args[3]+"&v=7"; | ||
650 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
651 | - </BeanShellPreProcessor> | ||
652 | - <hashTree/> | ||
653 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
654 | - <collectionProp name="Asserion.test_strings"> | ||
655 | - <stringProp name="1450572480">"code":200</stringProp> | ||
656 | - </collectionProp> | ||
657 | - <stringProp name="TestPlan.comments"></stringProp> | ||
658 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
659 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
660 | - <intProp name="Assertion.test_type">16</intProp> | ||
661 | - </ResponseAssertion> | ||
662 | - <hashTree/> | ||
663 | - </hashTree> | ||
664 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
665 | - <stringProp name="TestPlan.comments"></stringProp> | ||
666 | - <doubleProp> | ||
667 | - <name>throughput</name> | ||
668 | - <value>600</value> | ||
669 | - <savedValue>0.0</savedValue> | ||
670 | - </doubleProp> | ||
671 | - <intProp name="calcMode">2</intProp> | ||
672 | - </ConstantThroughputTimer> | ||
673 | - <hashTree/> | ||
674 | - </hashTree> | ||
675 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_payment" enabled="true"> | ||
676 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
677 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
678 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
679 | - <intProp name="LoopController.loops">-1</intProp> | ||
680 | - </elementProp> | ||
681 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
682 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
683 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
684 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
685 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
686 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
687 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
688 | - <stringProp name="TestPlan.comments">结算</stringProp> | ||
689 | - </ThreadGroup> | ||
690 | - <hashTree> | ||
691 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_payment" enabled="true"> | ||
692 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
693 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
694 | - <collectionProp name="Arguments.arguments"> | ||
695 | - <elementProp name="" elementType="HTTPArgument"> | ||
696 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
697 | - <stringProp name="Argument.value"></stringProp> | ||
698 | - <stringProp name="Argument.metadata">=</stringProp> | ||
699 | - </elementProp> | ||
700 | - </collectionProp> | ||
701 | - </elementProp> | ||
702 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
703 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
704 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
705 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
706 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
707 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
708 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
709 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
710 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
711 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
712 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
713 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
714 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
715 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
716 | - <stringProp name="TestPlan.comments">结算</stringProp> | ||
717 | - </HTTPSamplerProxy> | ||
718 | - <hashTree> | ||
719 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
720 | - <stringProp name="TestPlan.comments"></stringProp> | ||
721 | - <boolProp name="resetInterpreter">false</boolProp> | ||
722 | - <stringProp name="parameters">${SNCP} ${uid_edit}</stringProp> | ||
723 | - <stringProp name="filename"></stringProp> | ||
724 | - <stringProp name="script">import java.security.MessageDigest; | ||
725 | -import java.util.Random; | ||
726 | -String[] clientTypes = {"android","iphone"}; | ||
727 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
728 | -int rd = new Random().nextInt(2); | ||
729 | -String clientType = clientTypes[rd]; | ||
730 | -String privateKey = privateKeys[rd]; | ||
731 | -String os_version = "yohobuy:h5"; | ||
732 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&cart_type=ordinary&client_type="+clientType+"&enable_red_envelopes=0&method=app.Shopping.payment&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=3c69ae945a5d2288b4de540ddcc8b24a&uid="+bsh.args[1]+"&v=7&yoho_coin_mode=0"; | ||
733 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
734 | -byte[] btInput = req.getBytes(); | ||
735 | -md.update(btInput); | ||
736 | -byte[] btResult = md.digest(); | ||
737 | -StringBuffer sb = new StringBuffer(); | ||
738 | -for(byte b : btResult){ | ||
739 | - int bt = b&0xff; | ||
740 | - if(bt<16){ | ||
741 | - sb.append(0); | ||
742 | - } | ||
743 | - sb.append(Integer.toHexString(bt)); | ||
744 | -} | ||
745 | -String md5 = sb.toString(); | ||
746 | -os_version=URLEncoder.encode(os_version); | ||
747 | -req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&cart_type=ordinary&client_type="+clientType+"&enable_red_envelopes=0&method=app.Shopping.payment&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=3c69ae945a5d2288b4de540ddcc8b24a&uid="+bsh.args[1]+"&v=7&yoho_coin_mode=0"; | ||
748 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
749 | - </BeanShellPreProcessor> | ||
750 | - <hashTree/> | ||
751 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
752 | - <collectionProp name="Asserion.test_strings"> | ||
753 | - <stringProp name="1450572480">"code":200</stringProp> | ||
754 | - </collectionProp> | ||
755 | - <stringProp name="TestPlan.comments"></stringProp> | ||
756 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
757 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
758 | - <intProp name="Assertion.test_type">16</intProp> | ||
759 | - </ResponseAssertion> | ||
760 | - <hashTree/> | ||
761 | - </hashTree> | ||
762 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
763 | - <stringProp name="TestPlan.comments"></stringProp> | ||
764 | - <doubleProp> | ||
765 | - <name>throughput</name> | ||
766 | - <value>600</value> | ||
767 | - <savedValue>0.0</savedValue> | ||
768 | - </doubleProp> | ||
769 | - <intProp name="calcMode">2</intProp> | ||
770 | - </ConstantThroughputTimer> | ||
771 | - <hashTree/> | ||
772 | - </hashTree> | ||
773 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_address_get" enabled="true"> | ||
774 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
775 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
776 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
777 | - <intProp name="LoopController.loops">-1</intProp> | ||
778 | - </elementProp> | ||
779 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
780 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
781 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
782 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
783 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
784 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
785 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
786 | - <stringProp name="TestPlan.comments">获取地址</stringProp> | ||
787 | - </ThreadGroup> | ||
788 | - <hashTree> | ||
789 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_address_get" enabled="true"> | ||
790 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
791 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
792 | - <collectionProp name="Arguments.arguments"> | ||
793 | - <elementProp name="" elementType="HTTPArgument"> | ||
794 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
795 | - <stringProp name="Argument.value"></stringProp> | ||
796 | - <stringProp name="Argument.metadata">=</stringProp> | ||
797 | - </elementProp> | ||
798 | - </collectionProp> | ||
799 | - </elementProp> | ||
800 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
801 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
802 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
803 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
804 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
805 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
806 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
807 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
808 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
809 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
810 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
811 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
812 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
813 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
814 | - <stringProp name="TestPlan.comments">获取地址</stringProp> | ||
815 | - </HTTPSamplerProxy> | ||
816 | - <hashTree> | ||
817 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
818 | - <stringProp name="TestPlan.comments"></stringProp> | ||
819 | - <boolProp name="resetInterpreter">false</boolProp> | ||
820 | - <stringProp name="parameters">${SNCP} ${uid_edit}</stringProp> | ||
821 | - <stringProp name="filename"></stringProp> | ||
822 | - <stringProp name="script">import java.security.MessageDigest; | ||
823 | -import java.util.Random; | ||
824 | -String[] clientTypes = {"android","iphone"}; | ||
825 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
826 | -int rd = new Random().nextInt(2); | ||
827 | -String clientType = clientTypes[rd]; | ||
828 | -String privateKey = privateKeys[rd]; | ||
829 | - | ||
830 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&fromPage=iFP_AppDelegate&method=app.address.getlist&os_version=10.3.1&physical_channel=1&private_key="+privateKey+"&screen_size=375x667&udid=155baae56a5ce7d9e7f9bf037a41a9e8fd766dda&uid="+bsh.args[1]+"&v=7"; | ||
831 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
832 | -byte[] btInput = req.getBytes(); | ||
833 | -md.update(btInput); | ||
834 | -byte[] btResult = md.digest(); | ||
835 | -StringBuffer sb = new StringBuffer(); | ||
836 | -for(byte b : btResult){ | ||
837 | - int bt = b&0xff; | ||
838 | - if(bt<16){ | ||
839 | - sb.append(0); | ||
840 | - } | ||
841 | - sb.append(Integer.toHexString(bt)); | ||
842 | -} | ||
843 | -String md5 = sb.toString(); | ||
844 | - | ||
845 | - | ||
846 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
847 | - </BeanShellPreProcessor> | ||
848 | - <hashTree/> | ||
849 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
850 | - <collectionProp name="Asserion.test_strings"> | ||
851 | - <stringProp name="1450572480">"code":200</stringProp> | ||
852 | - </collectionProp> | ||
853 | - <stringProp name="TestPlan.comments"></stringProp> | ||
854 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
855 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
856 | - <intProp name="Assertion.test_type">16</intProp> | ||
857 | - </ResponseAssertion> | ||
858 | - <hashTree/> | ||
859 | - </hashTree> | ||
860 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
861 | - <stringProp name="TestPlan.comments"></stringProp> | ||
862 | - <doubleProp> | ||
863 | - <name>throughput</name> | ||
864 | - <value>600</value> | ||
865 | - <savedValue>0.0</savedValue> | ||
866 | - </doubleProp> | ||
867 | - <intProp name="calcMode">2</intProp> | ||
868 | - </ConstantThroughputTimer> | ||
869 | - <hashTree/> | ||
870 | - </hashTree> | ||
871 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_countUsableCoupon" enabled="true"> | ||
872 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
873 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
874 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
875 | - <intProp name="LoopController.loops">-1</intProp> | ||
876 | - </elementProp> | ||
877 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
878 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
879 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
880 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
881 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
882 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
883 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
884 | - <stringProp name="TestPlan.comments">可用优惠券数量(是否可降级)</stringProp> | ||
885 | - </ThreadGroup> | ||
886 | - <hashTree> | ||
887 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_countUsableCoupon" enabled="true"> | ||
888 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
889 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
890 | - <collectionProp name="Arguments.arguments"> | ||
891 | - <elementProp name="" elementType="HTTPArgument"> | ||
892 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
893 | - <stringProp name="Argument.value"></stringProp> | ||
894 | - <stringProp name="Argument.metadata">=</stringProp> | ||
895 | - </elementProp> | ||
896 | - </collectionProp> | ||
897 | - </elementProp> | ||
898 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
899 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
900 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
901 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
902 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
903 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
904 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
905 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
906 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
907 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
908 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
909 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
910 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
911 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
912 | - <stringProp name="TestPlan.comments">可用优惠券数量(是否可降级)</stringProp> | ||
913 | - </HTTPSamplerProxy> | ||
914 | - <hashTree> | ||
915 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
916 | - <stringProp name="TestPlan.comments"></stringProp> | ||
917 | - <boolProp name="resetInterpreter">false</boolProp> | ||
918 | - <stringProp name="parameters">${SNCP} ${uid_edit}</stringProp> | ||
919 | - <stringProp name="filename"></stringProp> | ||
920 | - <stringProp name="script">import java.security.MessageDigest; | ||
921 | -import java.util.Random; | ||
922 | -String[] clientTypes = {"android","iphone"}; | ||
923 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
924 | -int rd = new Random().nextInt(2); | ||
925 | -String clientType = clientTypes[rd]; | ||
926 | -String privateKey = privateKeys[rd]; | ||
927 | - | ||
928 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.0&client_type="+clientType+"&fromPage=iFP_Payment&method=app.Shopping.countUsableCoupon&os_version=10.3.2&physical_channel=1&private_key="+privateKey+"&screen_size=375x667&session_key=0036166666e1789b366fd4404832988d&udid=795bfa0ea3f3669974fbef4e9238a965a3e942ff&uid="+bsh.args[1]+"&v=7"; | ||
929 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
930 | -byte[] btInput = req.getBytes(); | ||
931 | -md.update(btInput); | ||
932 | -byte[] btResult = md.digest(); | ||
933 | -StringBuffer sb = new StringBuffer(); | ||
934 | -for(byte b : btResult){ | ||
935 | - int bt = b&0xff; | ||
936 | - if(bt<16){ | ||
937 | - sb.append(0); | ||
938 | - } | ||
939 | - sb.append(Integer.toHexString(bt)); | ||
940 | -} | ||
941 | -String md5 = sb.toString(); | ||
942 | - | ||
943 | - | ||
944 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
945 | - </BeanShellPreProcessor> | ||
946 | - <hashTree/> | ||
947 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
948 | - <collectionProp name="Asserion.test_strings"> | ||
949 | - <stringProp name="1450572480">"code":200</stringProp> | ||
950 | - </collectionProp> | ||
951 | - <stringProp name="TestPlan.comments"></stringProp> | ||
952 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
953 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
954 | - <intProp name="Assertion.test_type">16</intProp> | ||
955 | - </ResponseAssertion> | ||
956 | - <hashTree/> | ||
957 | - </hashTree> | ||
958 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
959 | - <stringProp name="TestPlan.comments"></stringProp> | ||
960 | - <doubleProp> | ||
961 | - <name>throughput</name> | ||
962 | - <value>600</value> | ||
963 | - <savedValue>0.0</savedValue> | ||
964 | - </doubleProp> | ||
965 | - <intProp name="calcMode">2</intProp> | ||
966 | - </ConstantThroughputTimer> | ||
967 | - <hashTree/> | ||
968 | - </hashTree> | ||
969 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_compute" enabled="true"> | ||
970 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
971 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
972 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
973 | - <intProp name="LoopController.loops">-1</intProp> | ||
974 | - </elementProp> | ||
975 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
976 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
977 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
978 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
979 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
980 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
981 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
982 | - <stringProp name="TestPlan.comments">计算</stringProp> | ||
983 | - </ThreadGroup> | ||
984 | - <hashTree> | ||
985 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_compute" enabled="true"> | ||
986 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
987 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
988 | - <collectionProp name="Arguments.arguments"> | ||
989 | - <elementProp name="" elementType="HTTPArgument"> | ||
990 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
991 | - <stringProp name="Argument.value"></stringProp> | ||
992 | - <stringProp name="Argument.metadata">=</stringProp> | ||
993 | - </elementProp> | ||
994 | - </collectionProp> | ||
995 | - </elementProp> | ||
996 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
997 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
998 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
999 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
1000 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
1001 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
1002 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
1003 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
1004 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
1005 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
1006 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
1007 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
1008 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
1009 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
1010 | - <stringProp name="TestPlan.comments">计算</stringProp> | ||
1011 | - </HTTPSamplerProxy> | ||
1012 | - <hashTree> | ||
1013 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
1014 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1015 | - <boolProp name="resetInterpreter">false</boolProp> | ||
1016 | - <stringProp name="parameters">${SNCP} ${coupon_code_edit} ${uid_edit}</stringProp> | ||
1017 | - <stringProp name="filename"></stringProp> | ||
1018 | - <stringProp name="script">import java.security.MessageDigest; | ||
1019 | -import java.util.Random; | ||
1020 | -String[] clientTypes = {"android","iphone"}; | ||
1021 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
1022 | -int rd = new Random().nextInt(2); | ||
1023 | -String clientType = clientTypes[rd]; | ||
1024 | -String privateKey = privateKeys[rd]; | ||
1025 | -String os_version = "yohobuy:h5"; | ||
1026 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&cart_type=ordinary&client_type="+clientType+"&coupon_code="+bsh.args[1]+"&delivery_way=2&method=app.Shopping.compute&os_version="+os_version+"&payment_type=2&private_key="+privateKey+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&uid="+bsh.args[2]+"&use_yoho_coin=0&v=7"; | ||
1027 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
1028 | -byte[] btInput = req.getBytes(); | ||
1029 | -md.update(btInput); | ||
1030 | -byte[] btResult = md.digest(); | ||
1031 | -StringBuffer sb = new StringBuffer(); | ||
1032 | -for(byte b : btResult){ | ||
1033 | - int bt = b&0xff; | ||
1034 | - if(bt<16){ | ||
1035 | - sb.append(0); | ||
1036 | - } | ||
1037 | - sb.append(Integer.toHexString(bt)); | ||
1038 | -} | ||
1039 | -String md5 = sb.toString(); | ||
1040 | -os_version=URLEncoder.encode(os_version); | ||
1041 | -req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&cart_type=ordinary&client_type="+clientType+"&coupon_code="+bsh.args[1]+"&delivery_way=2&method=app.Shopping.compute&os_version="+os_version+"&payment_type=2&private_key="+privateKey+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&uid="+bsh.args[2]+"&use_yoho_coin=0&v=7"; | ||
1042 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
1043 | - </BeanShellPreProcessor> | ||
1044 | - <hashTree/> | ||
1045 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
1046 | - <collectionProp name="Asserion.test_strings"> | ||
1047 | - <stringProp name="1450572480">"code":200</stringProp> | ||
1048 | - </collectionProp> | ||
1049 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1050 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
1051 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
1052 | - <intProp name="Assertion.test_type">16</intProp> | ||
1053 | - </ResponseAssertion> | ||
1054 | - <hashTree/> | ||
1055 | - </hashTree> | ||
1056 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
1057 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1058 | - <doubleProp> | ||
1059 | - <name>throughput</name> | ||
1060 | - <value>600</value> | ||
1061 | - <savedValue>0.0</savedValue> | ||
1062 | - </doubleProp> | ||
1063 | - <intProp name="calcMode">2</intProp> | ||
1064 | - </ConstantThroughputTimer> | ||
1065 | - <hashTree/> | ||
1066 | - </hashTree> | ||
1067 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_useCoupon" enabled="true"> | ||
1068 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
1069 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
1070 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
1071 | - <intProp name="LoopController.loops">-1</intProp> | ||
1072 | - </elementProp> | ||
1073 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
1074 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
1075 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
1076 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
1077 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
1078 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
1079 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
1080 | - <stringProp name="TestPlan.comments">使用优惠券</stringProp> | ||
1081 | - </ThreadGroup> | ||
1082 | - <hashTree> | ||
1083 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_useCoupon" enabled="true"> | ||
1084 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
1085 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
1086 | - <collectionProp name="Arguments.arguments"> | ||
1087 | - <elementProp name="" elementType="HTTPArgument"> | ||
1088 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
1089 | - <stringProp name="Argument.value"></stringProp> | ||
1090 | - <stringProp name="Argument.metadata">=</stringProp> | ||
1091 | - </elementProp> | ||
1092 | - </collectionProp> | ||
1093 | - </elementProp> | ||
1094 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
1095 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
1096 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
1097 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
1098 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
1099 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
1100 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
1101 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
1102 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
1103 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
1104 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
1105 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
1106 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
1107 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
1108 | - <stringProp name="TestPlan.comments">使用优惠券</stringProp> | ||
1109 | - </HTTPSamplerProxy> | ||
1110 | - <hashTree> | ||
1111 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
1112 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1113 | - <boolProp name="resetInterpreter">false</boolProp> | ||
1114 | - <stringProp name="parameters">${SNCP} ${coupon_code_edit} ${uid_edit}</stringProp> | ||
1115 | - <stringProp name="filename"></stringProp> | ||
1116 | - <stringProp name="script">import java.security.MessageDigest; | ||
1117 | -import java.util.Random; | ||
1118 | -String[] clientTypes = {"android","iphone"}; | ||
1119 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
1120 | -int rd = new Random().nextInt(2); | ||
1121 | -String clientType = clientTypes[rd]; | ||
1122 | -String privateKey = privateKeys[rd]; | ||
1123 | -String os_version = "yohobuy:h5"; | ||
1124 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&client_type="+clientType+"&coupon_code="+bsh.args[1]+"&method=app.Shopping.useCoupon&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=2ac3924dc4ae71a6e1f75e844e558c5b&uid="+bsh.args[2]+"&v=7"; | ||
1125 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
1126 | -byte[] btInput = req.getBytes(); | ||
1127 | -md.update(btInput); | ||
1128 | -byte[] btResult = md.digest(); | ||
1129 | -StringBuffer sb = new StringBuffer(); | ||
1130 | -for(byte b : btResult){ | ||
1131 | - int bt = b&0xff; | ||
1132 | - if(bt<16){ | ||
1133 | - sb.append(0); | ||
1134 | - } | ||
1135 | - sb.append(Integer.toHexString(bt)); | ||
1136 | -} | ||
1137 | -String md5 = sb.toString(); | ||
1138 | -os_version=URLEncoder.encode(os_version); | ||
1139 | -req = "_sncp="+bsh.args[0]+"&app_version=5.9.0&client_type="+clientType+"&coupon_code="+bsh.args[1]+"&method=app.Shopping.useCoupon&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=2ac3924dc4ae71a6e1f75e844e558c5b&uid="+bsh.args[2]+"&v=7"; | ||
1140 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
1141 | - </BeanShellPreProcessor> | ||
1142 | - <hashTree/> | ||
1143 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
1144 | - <collectionProp name="Asserion.test_strings"> | ||
1145 | - <stringProp name="1450572480">"code":200</stringProp> | ||
1146 | - </collectionProp> | ||
1147 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1148 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
1149 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
1150 | - <intProp name="Assertion.test_type">16</intProp> | ||
1151 | - </ResponseAssertion> | ||
1152 | - <hashTree/> | ||
1153 | - </hashTree> | ||
1154 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
1155 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1156 | - <doubleProp> | ||
1157 | - <name>throughput</name> | ||
1158 | - <value>600</value> | ||
1159 | - <savedValue>0.0</savedValue> | ||
1160 | - </doubleProp> | ||
1161 | - <intProp name="calcMode">2</intProp> | ||
1162 | - </ConstantThroughputTimer> | ||
1163 | - <hashTree/> | ||
1164 | - </hashTree> | ||
1165 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_listCoupon" enabled="true"> | ||
1166 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
1167 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
1168 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
1169 | - <intProp name="LoopController.loops">-1</intProp> | ||
1170 | - </elementProp> | ||
1171 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
1172 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
1173 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
1174 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
1175 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
1176 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
1177 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
1178 | - <stringProp name="TestPlan.comments">购物车优惠卷列表</stringProp> | ||
1179 | - </ThreadGroup> | ||
1180 | - <hashTree> | ||
1181 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_listCoupon" enabled="true"> | ||
1182 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
1183 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
1184 | - <collectionProp name="Arguments.arguments"> | ||
1185 | - <elementProp name="" elementType="HTTPArgument"> | ||
1186 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
1187 | - <stringProp name="Argument.value"></stringProp> | ||
1188 | - <stringProp name="Argument.metadata">=</stringProp> | ||
1189 | - </elementProp> | ||
1190 | - </collectionProp> | ||
1191 | - </elementProp> | ||
1192 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
1193 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
1194 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
1195 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
1196 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
1197 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
1198 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
1199 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
1200 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
1201 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
1202 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
1203 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
1204 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
1205 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
1206 | - <stringProp name="TestPlan.comments">购物车优惠卷列表</stringProp> | ||
1207 | - </HTTPSamplerProxy> | ||
1208 | - <hashTree> | ||
1209 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
1210 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1211 | - <boolProp name="resetInterpreter">false</boolProp> | ||
1212 | - <stringProp name="parameters">${SNCP} ${uid_edit}</stringProp> | ||
1213 | - <stringProp name="filename"></stringProp> | ||
1214 | - <stringProp name="script">import java.security.MessageDigest; | ||
1215 | -import java.util.Random; | ||
1216 | -String[] clientTypes = {"android","iphone"}; | ||
1217 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
1218 | -int rd = new Random().nextInt(2); | ||
1219 | -String clientType = clientTypes[rd]; | ||
1220 | -String privateKey = privateKeys[rd]; | ||
1221 | - | ||
1222 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&fromPage=iFP_Coupon&method=app.Shopping.listCoupon&os_version=10.1&physical_channel=1&private_key="+privateKey+"&screen_size=414x736&session_key=2852ccbc7781da50012a8ad7ba0ebb6e&udid=a0a2667c59c4024861ea3b49d376d9278fb6d809&uid="+bsh.args[1]+"&v=7"; | ||
1223 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
1224 | -byte[] btInput = req.getBytes(); | ||
1225 | -md.update(btInput); | ||
1226 | -byte[] btResult = md.digest(); | ||
1227 | -StringBuffer sb = new StringBuffer(); | ||
1228 | -for(byte b : btResult){ | ||
1229 | - int bt = b&0xff; | ||
1230 | - if(bt<16){ | ||
1231 | - sb.append(0); | ||
1232 | - } | ||
1233 | - sb.append(Integer.toHexString(bt)); | ||
1234 | -} | ||
1235 | -String md5 = sb.toString(); | ||
1236 | - | ||
1237 | - | ||
1238 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
1239 | - </BeanShellPreProcessor> | ||
1240 | - <hashTree/> | ||
1241 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
1242 | - <collectionProp name="Asserion.test_strings"> | ||
1243 | - <stringProp name="1450572480">"code":200</stringProp> | ||
1244 | - </collectionProp> | ||
1245 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1246 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
1247 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
1248 | - <intProp name="Assertion.test_type">16</intProp> | ||
1249 | - </ResponseAssertion> | ||
1250 | - <hashTree/> | ||
1251 | - </hashTree> | ||
1252 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
1253 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1254 | - <doubleProp> | ||
1255 | - <name>throughput</name> | ||
1256 | - <value>600</value> | ||
1257 | - <savedValue>0.0</savedValue> | ||
1258 | - </doubleProp> | ||
1259 | - <intProp name="calcMode">2</intProp> | ||
1260 | - </ConstantThroughputTimer> | ||
1261 | - <hashTree/> | ||
1262 | - </hashTree> | ||
1263 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_payment_findPayListDetail" enabled="true"> | ||
1264 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
1265 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
1266 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
1267 | - <intProp name="LoopController.loops">-1</intProp> | ||
1268 | - </elementProp> | ||
1269 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
1270 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
1271 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
1272 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
1273 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
1274 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
1275 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
1276 | - <stringProp name="TestPlan.comments">支付列表信息</stringProp> | ||
1277 | - </ThreadGroup> | ||
1278 | - <hashTree> | ||
1279 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_payment_findPayListDetail" enabled="true"> | ||
1280 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
1281 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
1282 | - <collectionProp name="Arguments.arguments"> | ||
1283 | - <elementProp name="" elementType="HTTPArgument"> | ||
1284 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
1285 | - <stringProp name="Argument.value"></stringProp> | ||
1286 | - <stringProp name="Argument.metadata">=</stringProp> | ||
1287 | - </elementProp> | ||
1288 | - </collectionProp> | ||
1289 | - </elementProp> | ||
1290 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
1291 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
1292 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
1293 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
1294 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
1295 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
1296 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
1297 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
1298 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
1299 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
1300 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
1301 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
1302 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
1303 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
1304 | - <stringProp name="TestPlan.comments">支付列表信息</stringProp> | ||
1305 | - </HTTPSamplerProxy> | ||
1306 | - <hashTree> | ||
1307 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
1308 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1309 | - <boolProp name="resetInterpreter">false</boolProp> | ||
1310 | - <stringProp name="parameters">${SNCP} ${uid_submit}</stringProp> | ||
1311 | - <stringProp name="filename"></stringProp> | ||
1312 | - <stringProp name="script">import java.security.MessageDigest; | ||
1313 | -import java.util.Random; | ||
1314 | -String[] clientTypes = {"android","iphone"}; | ||
1315 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
1316 | -int rd = new Random().nextInt(2); | ||
1317 | -String clientType = clientTypes[rd]; | ||
1318 | -String privateKey = privateKeys[rd]; | ||
1319 | -String os_version = "android5.0.2:vivo_Y33"; | ||
1320 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&fromPage=aFP_ChoosePayWay&gender=1,3&method=app.payment.findPayListDetail&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&screen_size=720x1280&session_key=f0c318ece4d0aba1dffa909bda9114bf&udid=8688590290067987d3cae6cca3e561a&uid="+bsh.args[1]+"&v=7&yh_channel=1"; | ||
1321 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
1322 | -byte[] btInput = req.getBytes(); | ||
1323 | -md.update(btInput); | ||
1324 | -byte[] btResult = md.digest(); | ||
1325 | -StringBuffer sb = new StringBuffer(); | ||
1326 | -for(byte b : btResult){ | ||
1327 | - int bt = b&0xff; | ||
1328 | - if(bt<16){ | ||
1329 | - sb.append(0); | ||
1330 | - } | ||
1331 | - sb.append(Integer.toHexString(bt)); | ||
1332 | -} | ||
1333 | -String md5 = sb.toString(); | ||
1334 | -os_version=URLEncoder.encode(os_version); | ||
1335 | -req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&fromPage=aFP_ChoosePayWay&gender=1,3&method=app.payment.findPayListDetail&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&screen_size=720x1280&session_key=f0c318ece4d0aba1dffa909bda9114bf&udid=8688590290067987d3cae6cca3e561a&uid="+bsh.args[1]+"&v=7&yh_channel=1"; | ||
1336 | -vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
1337 | - </BeanShellPreProcessor> | ||
1338 | - <hashTree/> | ||
1339 | - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
1340 | - <collectionProp name="Asserion.test_strings"> | ||
1341 | - <stringProp name="1450572480">"code":200</stringProp> | ||
1342 | - </collectionProp> | ||
1343 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1344 | - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
1345 | - <boolProp name="Assertion.assume_success">false</boolProp> | ||
1346 | - <intProp name="Assertion.test_type">16</intProp> | ||
1347 | - </ResponseAssertion> | ||
1348 | - <hashTree/> | ||
1349 | - </hashTree> | ||
1350 | - <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
1351 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1352 | - <doubleProp> | ||
1353 | - <name>throughput</name> | ||
1354 | - <value>600</value> | ||
1355 | - <savedValue>0.0</savedValue> | ||
1356 | - </doubleProp> | ||
1357 | - <intProp name="calcMode">2</intProp> | ||
1358 | - </ConstantThroughputTimer> | ||
1359 | - <hashTree/> | ||
1360 | - </hashTree> | ||
1361 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_recommend_purchased" enabled="true"> | ||
1362 | - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
1363 | - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
1364 | - <boolProp name="LoopController.continue_forever">false</boolProp> | ||
1365 | - <intProp name="LoopController.loops">-1</intProp> | ||
1366 | - </elementProp> | ||
1367 | - <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
1368 | - <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
1369 | - <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
1370 | - <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
1371 | - <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
1372 | - <stringProp name="ThreadGroup.duration"></stringProp> | ||
1373 | - <stringProp name="ThreadGroup.delay"></stringProp> | ||
1374 | - <stringProp name="TestPlan.comments">买了再买功能</stringProp> | ||
1375 | - </ThreadGroup> | ||
1376 | - <hashTree> | ||
1377 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_recommend_purchased" enabled="true"> | ||
1378 | - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
1379 | - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
1380 | - <collectionProp name="Arguments.arguments"> | ||
1381 | - <elementProp name="" elementType="HTTPArgument"> | ||
1382 | - <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
1383 | - <stringProp name="Argument.value"></stringProp> | ||
1384 | - <stringProp name="Argument.metadata">=</stringProp> | ||
1385 | - </elementProp> | ||
1386 | - </collectionProp> | ||
1387 | - </elementProp> | ||
1388 | - <stringProp name="HTTPSampler.domain"></stringProp> | ||
1389 | - <stringProp name="HTTPSampler.port"></stringProp> | ||
1390 | - <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
1391 | - <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
1392 | - <stringProp name="HTTPSampler.protocol"></stringProp> | ||
1393 | - <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
1394 | - <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
1395 | - <stringProp name="HTTPSampler.method">GET</stringProp> | ||
1396 | - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
1397 | - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
1398 | - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
1399 | - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
1400 | - <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
1401 | - <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
1402 | - <stringProp name="TestPlan.comments">买了再买功能</stringProp> | ||
1403 | - </HTTPSamplerProxy> | ||
1404 | - <hashTree> | ||
1405 | - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
1406 | - <stringProp name="TestPlan.comments"></stringProp> | ||
1407 | - <boolProp name="resetInterpreter">false</boolProp> | ||
1408 | - <stringProp name="parameters">${SNCP} ${product_skn} ${uid_edit}</stringProp> | ||
1409 | - <stringProp name="filename"></stringProp> | ||
1410 | - <stringProp name="script">import java.security.MessageDigest; | ||
1411 | -import java.util.Random; | ||
1412 | -String[] clientTypes = {"android","iphone"}; | ||
1413 | -String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
1414 | -int rd = new Random().nextInt(2); | ||
1415 | -String clientType = clientTypes[rd]; | ||
1416 | -String privateKey = privateKeys[rd]; | ||
1417 | - | ||
1418 | -String req = "_sncp="+bsh.args[0]+"&app_version=5.8.1&client_type="+clientType+"&limit=2&method=app.recommend.purchased&os_version=10.0.2&physical_channel=1&private_key="+privateKey+"&productSkn="+bsh.args[1]+"&rec_pos=100007&screen_size=375x667&session_key=9ca3b28ae75a7cf8790cf9a79a61cda3&udid=d961ca21607cfc982caafdc23630f9461b373fb3&uid="+bsh.args[2]+"&v=7"; | ||
1419 | -MessageDigest md = MessageDigest.getInstance("MD5"); | ||
1420 | -byte[] btInput = req.getBytes(); | ||
1421 | -md.update(btInput); | ||
1422 | -byte[] btResult = md.digest(); | ||
1423 | -StringBuffer sb = new StringBuffer(); | ||
1424 | -for(byte b : btResult){ | ||
1425 | - int bt = b&0xff; | ||
1426 | - if(bt<16){ | ||
1427 | - sb.append(0); | ||
1428 | - } | ||
1429 | - sb.append(Integer.toHexString(bt)); | ||
1430 | -} | ||
1431 | -String md5 = sb.toString(); | ||
1432 | - | ||
1433 | - | 119 | +req = "activityId=384&app_version=6.7.0&business_line=yohobuy&client_type="+clientType+"&fromPage=aFP_Queue&gender=1,3&method=app.drawline.addQueue&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1920&session_key=eda4ab2daa1ea85bcd4ef79ce9ccbe2f&udid=866899023021106371c7743458299a6&uid="+bsh.args[0]+"&v=7&vip_level=0&yh_channel=1"; |
1434 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | 120 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> |
1435 | </BeanShellPreProcessor> | 121 | </BeanShellPreProcessor> |
1436 | <hashTree/> | 122 | <hashTree/> |
-
Please register or login to post a comment