Showing
1 changed file
with
204 additions
and
8 deletions
@@ -204,7 +204,7 @@ | @@ -204,7 +204,7 @@ | ||
204 | <stringProp name="shareMode">shareMode.all</stringProp> | 204 | <stringProp name="shareMode">shareMode.all</stringProp> |
205 | </CSVDataSet> | 205 | </CSVDataSet> |
206 | <hashTree/> | 206 | <hashTree/> |
207 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_product_shopRecommend" enabled="true"> | 207 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_newproduct_recbrand" enabled="true"> |
208 | <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | 208 | <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> |
209 | <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | 209 | <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> |
210 | <boolProp name="LoopController.continue_forever">false</boolProp> | 210 | <boolProp name="LoopController.continue_forever">false</boolProp> |
@@ -217,10 +217,10 @@ | @@ -217,10 +217,10 @@ | ||
217 | <boolProp name="ThreadGroup.scheduler">false</boolProp> | 217 | <boolProp name="ThreadGroup.scheduler">false</boolProp> |
218 | <stringProp name="ThreadGroup.duration"></stringProp> | 218 | <stringProp name="ThreadGroup.duration"></stringProp> |
219 | <stringProp name="ThreadGroup.delay"></stringProp> | 219 | <stringProp name="ThreadGroup.delay"></stringProp> |
220 | - <stringProp name="TestPlan.comments">商品详情页底部店铺推荐(提供给web使用)</stringProp> | 220 | + <stringProp name="TestPlan.comments">新品到着推荐品牌</stringProp> |
221 | </ThreadGroup> | 221 | </ThreadGroup> |
222 | <hashTree> | 222 | <hashTree> |
223 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_product_shopRecommend" enabled="true"> | 223 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_newproduct_recbrand" enabled="true"> |
224 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | 224 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> |
225 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | 225 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> |
226 | <collectionProp name="Arguments.arguments"> | 226 | <collectionProp name="Arguments.arguments"> |
@@ -245,13 +245,13 @@ | @@ -245,13 +245,13 @@ | ||
245 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | 245 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> |
246 | <boolProp name="HTTPSampler.monitor">false</boolProp> | 246 | <boolProp name="HTTPSampler.monitor">false</boolProp> |
247 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | 247 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> |
248 | - <stringProp name="TestPlan.comments">商品详情页底部店铺推荐(提供给web使用)</stringProp> | 248 | + <stringProp name="TestPlan.comments">新品到着推荐品牌</stringProp> |
249 | </HTTPSamplerProxy> | 249 | </HTTPSamplerProxy> |
250 | <hashTree> | 250 | <hashTree> |
251 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | 251 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> |
252 | <stringProp name="TestPlan.comments"></stringProp> | 252 | <stringProp name="TestPlan.comments"></stringProp> |
253 | <boolProp name="resetInterpreter">false</boolProp> | 253 | <boolProp name="resetInterpreter">false</boolProp> |
254 | - <stringProp name="parameters">${product_skn}</stringProp> | 254 | + <stringProp name="parameters">${uid}</stringProp> |
255 | <stringProp name="filename"></stringProp> | 255 | <stringProp name="filename"></stringProp> |
256 | <stringProp name="script">import java.security.MessageDigest; | 256 | <stringProp name="script">import java.security.MessageDigest; |
257 | import java.util.Random; | 257 | import java.util.Random; |
@@ -260,8 +260,204 @@ String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"}; | @@ -260,8 +260,204 @@ String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"}; | ||
260 | int rd = new Random().nextInt(1); | 260 | int rd = new Random().nextInt(1); |
261 | String clientType = clientTypes[rd]; | 261 | String clientType = clientTypes[rd]; |
262 | String privateKey = privateKeys[rd]; | 262 | String privateKey = privateKeys[rd]; |
263 | -String os_version = "yohobuy:web"; | ||
264 | -String req = "app_version=5.8.0&client_type="+clientType+"&limit=20&method=web.product.shopRecommend&os_version="+os_version+"&page=1&private_key="+privateKey+"&product_skn="+bsh.args[0]+"&screen_size=720x1280&v=7"; | 263 | + |
264 | +String req = "app_version=5.8.1&client_type="+clientType+"&limit=60&method=app.newproduct.recbrand&os_version=10.3.2&page=1&physical_channel=1&private_key="+privateKey+"&screen_size=414x736&session_key=437f86ad70b9832a1884c357b96e8ffe&udid=fc2fdedc84327f14de31f79adbcd0de61fad0afd&uid="+bsh.args[0]+"&v=7&yh_channel=1"; | ||
265 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
266 | +byte[] btInput = req.getBytes(); | ||
267 | +md.update(btInput); | ||
268 | +byte[] btResult = md.digest(); | ||
269 | +StringBuffer sb = new StringBuffer(); | ||
270 | +for(byte b : btResult){ | ||
271 | + int bt = b&0xff; | ||
272 | + if(bt<16){ | ||
273 | + sb.append(0); | ||
274 | + } | ||
275 | + sb.append(Integer.toHexString(bt)); | ||
276 | +} | ||
277 | +String md5 = sb.toString(); | ||
278 | + | ||
279 | + | ||
280 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
281 | + </BeanShellPreProcessor> | ||
282 | + <hashTree/> | ||
283 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
284 | + <collectionProp name="Asserion.test_strings"> | ||
285 | + <stringProp name="1450572480">"code":200</stringProp> | ||
286 | + </collectionProp> | ||
287 | + <stringProp name="TestPlan.comments"></stringProp> | ||
288 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
289 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
290 | + <intProp name="Assertion.test_type">16</intProp> | ||
291 | + </ResponseAssertion> | ||
292 | + <hashTree/> | ||
293 | + </hashTree> | ||
294 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
295 | + <stringProp name="TestPlan.comments"></stringProp> | ||
296 | + <doubleProp> | ||
297 | + <name>throughput</name> | ||
298 | + <value>60000</value> | ||
299 | + <savedValue>0.0</savedValue> | ||
300 | + </doubleProp> | ||
301 | + <intProp name="calcMode">2</intProp> | ||
302 | + </ConstantThroughputTimer> | ||
303 | + <hashTree/> | ||
304 | + </hashTree> | ||
305 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_newproduct_reclist" enabled="true"> | ||
306 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
307 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
308 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
309 | + <intProp name="LoopController.loops">-1</intProp> | ||
310 | + </elementProp> | ||
311 | + <stringProp name="ThreadGroup.num_threads">100</stringProp> | ||
312 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
313 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
314 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
315 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
316 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
317 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
318 | + <stringProp name="TestPlan.comments">新品到着推荐商品列表</stringProp> | ||
319 | + </ThreadGroup> | ||
320 | + <hashTree> | ||
321 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_newproduct_reclist" enabled="true"> | ||
322 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
323 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
324 | + <collectionProp name="Arguments.arguments"> | ||
325 | + <elementProp name="" elementType="HTTPArgument"> | ||
326 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
327 | + <stringProp name="Argument.value"></stringProp> | ||
328 | + <stringProp name="Argument.metadata">=</stringProp> | ||
329 | + </elementProp> | ||
330 | + </collectionProp> | ||
331 | + </elementProp> | ||
332 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
333 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
334 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
335 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
336 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
337 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
338 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
339 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
340 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
341 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
342 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
343 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
344 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
345 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
346 | + <stringProp name="TestPlan.comments">新品到着推荐商品列表</stringProp> | ||
347 | + </HTTPSamplerProxy> | ||
348 | + <hashTree> | ||
349 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
350 | + <stringProp name="TestPlan.comments"></stringProp> | ||
351 | + <boolProp name="resetInterpreter">false</boolProp> | ||
352 | + <stringProp name="parameters">${uid}</stringProp> | ||
353 | + <stringProp name="filename"></stringProp> | ||
354 | + <stringProp name="script">import java.security.MessageDigest; | ||
355 | +import java.util.Random; | ||
356 | +String[] clientTypes = {"android"}; | ||
357 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"}; | ||
358 | +int rd = new Random().nextInt(1); | ||
359 | +String clientType = clientTypes[rd]; | ||
360 | +String privateKey = privateKeys[rd]; | ||
361 | +String os_version = "android5.1.1:Redmi_Note_3"; | ||
362 | +String req = "app_version=5.8.1&client_type="+clientType+"&gender=1,3&limit=20&method=app.newproduct.reclist&order=&os_version="+os_version+"&page=1&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1920&session_key=7ddadfafd388aba86ff13f0d51adf591&udid=8610840369852596e0de9aef48b93f6&uid="+bsh.args[0]+"&v=7&yh_channel=1"; | ||
363 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
364 | +byte[] btInput = req.getBytes(); | ||
365 | +md.update(btInput); | ||
366 | +byte[] btResult = md.digest(); | ||
367 | +StringBuffer sb = new StringBuffer(); | ||
368 | +for(byte b : btResult){ | ||
369 | + int bt = b&0xff; | ||
370 | + if(bt<16){ | ||
371 | + sb.append(0); | ||
372 | + } | ||
373 | + sb.append(Integer.toHexString(bt)); | ||
374 | +} | ||
375 | +String md5 = sb.toString(); | ||
376 | +os_version=URLEncoder.encode(os_version); | ||
377 | +req = "app_version=5.8.1&client_type="+clientType+"&gender=1,3&limit=20&method=app.newproduct.reclist&order=&os_version="+os_version+"&page=1&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1920&session_key=7ddadfafd388aba86ff13f0d51adf591&udid=8610840369852596e0de9aef48b93f6&uid="+bsh.args[0]+"&v=7&yh_channel=1"; | ||
378 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
379 | + </BeanShellPreProcessor> | ||
380 | + <hashTree/> | ||
381 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
382 | + <collectionProp name="Asserion.test_strings"> | ||
383 | + <stringProp name="1450572480">"code":200</stringProp> | ||
384 | + </collectionProp> | ||
385 | + <stringProp name="TestPlan.comments"></stringProp> | ||
386 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
387 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
388 | + <intProp name="Assertion.test_type">16</intProp> | ||
389 | + </ResponseAssertion> | ||
390 | + <hashTree/> | ||
391 | + </hashTree> | ||
392 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
393 | + <stringProp name="TestPlan.comments"></stringProp> | ||
394 | + <doubleProp> | ||
395 | + <name>throughput</name> | ||
396 | + <value>60000</value> | ||
397 | + <savedValue>0.0</savedValue> | ||
398 | + </doubleProp> | ||
399 | + <intProp name="calcMode">2</intProp> | ||
400 | + </ConstantThroughputTimer> | ||
401 | + <hashTree/> | ||
402 | + </hashTree> | ||
403 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_newproduct_recshop" enabled="true"> | ||
404 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
405 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
406 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
407 | + <intProp name="LoopController.loops">-1</intProp> | ||
408 | + </elementProp> | ||
409 | + <stringProp name="ThreadGroup.num_threads">100</stringProp> | ||
410 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
411 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
412 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
413 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
414 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
415 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
416 | + <stringProp name="TestPlan.comments">新品到着推荐店铺</stringProp> | ||
417 | + </ThreadGroup> | ||
418 | + <hashTree> | ||
419 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_newproduct_recshop" enabled="true"> | ||
420 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
421 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
422 | + <collectionProp name="Arguments.arguments"> | ||
423 | + <elementProp name="" elementType="HTTPArgument"> | ||
424 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
425 | + <stringProp name="Argument.value"></stringProp> | ||
426 | + <stringProp name="Argument.metadata">=</stringProp> | ||
427 | + </elementProp> | ||
428 | + </collectionProp> | ||
429 | + </elementProp> | ||
430 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
431 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
432 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
433 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
434 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
435 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
436 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
437 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
438 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
439 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
440 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
441 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
442 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
443 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
444 | + <stringProp name="TestPlan.comments">新品到着推荐店铺</stringProp> | ||
445 | + </HTTPSamplerProxy> | ||
446 | + <hashTree> | ||
447 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
448 | + <stringProp name="TestPlan.comments"></stringProp> | ||
449 | + <boolProp name="resetInterpreter">false</boolProp> | ||
450 | + <stringProp name="parameters">${uid}</stringProp> | ||
451 | + <stringProp name="filename"></stringProp> | ||
452 | + <stringProp name="script">import java.security.MessageDigest; | ||
453 | +import java.util.Random; | ||
454 | +String[] clientTypes = {"android"}; | ||
455 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"}; | ||
456 | +int rd = new Random().nextInt(1); | ||
457 | +String clientType = clientTypes[rd]; | ||
458 | +String privateKey = privateKeys[rd]; | ||
459 | +String os_version = "android5.1.1:Redmi_Note_3"; | ||
460 | +String req = "app_version=5.8.1&client_type="+clientType+"&contentCode=1f2e07cb63811680154ba693c954dd62&gender=1,3&limit=10&method=app.newproduct.recshop&os_version="+os_version+"&page=1&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1920&session_key=7ddadfafd388aba86ff13f0d51adf591&udid=8610840369852596e0de9aef48b93f6&uid="+bsh.args[0]+"&v=7&yh_channel=1"; | ||
265 | MessageDigest md = MessageDigest.getInstance("MD5"); | 461 | MessageDigest md = MessageDigest.getInstance("MD5"); |
266 | byte[] btInput = req.getBytes(); | 462 | byte[] btInput = req.getBytes(); |
267 | md.update(btInput); | 463 | md.update(btInput); |
@@ -276,7 +472,7 @@ for(byte b : btResult){ | @@ -276,7 +472,7 @@ for(byte b : btResult){ | ||
276 | } | 472 | } |
277 | String md5 = sb.toString(); | 473 | String md5 = sb.toString(); |
278 | os_version=URLEncoder.encode(os_version); | 474 | os_version=URLEncoder.encode(os_version); |
279 | -req = "app_version=5.8.0&client_type="+clientType+"&limit=20&method=web.product.shopRecommend&os_version="+os_version+"&page=1&private_key="+privateKey+"&product_skn="+bsh.args[0]+"&screen_size=720x1280&v=7"; | 475 | +req = "app_version=5.8.1&client_type="+clientType+"&contentCode=1f2e07cb63811680154ba693c954dd62&gender=1,3&limit=10&method=app.newproduct.recshop&os_version="+os_version+"&page=1&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1920&session_key=7ddadfafd388aba86ff13f0d51adf591&udid=8610840369852596e0de9aef48b93f6&uid="+bsh.args[0]+"&v=7&yh_channel=1"; |
280 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | 476 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> |
281 | </BeanShellPreProcessor> | 477 | </BeanShellPreProcessor> |
282 | <hashTree/> | 478 | <hashTree/> |
-
Please register or login to post a comment