Showing
1 changed file
with
98 additions
and
0 deletions
@@ -9447,6 +9447,104 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | @@ -9447,6 +9447,104 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | ||
9447 | </ConstantThroughputTimer> | 9447 | </ConstantThroughputTimer> |
9448 | <hashTree/> | 9448 | <hashTree/> |
9449 | </hashTree> | 9449 | </hashTree> |
9450 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_sesame_flowering_higher" enabled="true"> | ||
9451 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
9452 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
9453 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
9454 | + <intProp name="LoopController.loops">-1</intProp> | ||
9455 | + </elementProp> | ||
9456 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
9457 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
9458 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
9459 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
9460 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
9461 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
9462 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
9463 | + <stringProp name="TestPlan.comments"></stringProp> | ||
9464 | + </ThreadGroup> | ||
9465 | + <hashTree> | ||
9466 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_sesame_flowering_higher" enabled="true"> | ||
9467 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
9468 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
9469 | + <collectionProp name="Arguments.arguments"> | ||
9470 | + <elementProp name="" elementType="HTTPArgument"> | ||
9471 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
9472 | + <stringProp name="Argument.value"></stringProp> | ||
9473 | + <stringProp name="Argument.metadata">=</stringProp> | ||
9474 | + </elementProp> | ||
9475 | + </collectionProp> | ||
9476 | + </elementProp> | ||
9477 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
9478 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
9479 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
9480 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
9481 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
9482 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
9483 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
9484 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
9485 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
9486 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
9487 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
9488 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
9489 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
9490 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
9491 | + <stringProp name="TestPlan.comments"></stringProp> | ||
9492 | + </HTTPSamplerProxy> | ||
9493 | + <hashTree> | ||
9494 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
9495 | + <stringProp name="TestPlan.comments"></stringProp> | ||
9496 | + <boolProp name="resetInterpreter">false</boolProp> | ||
9497 | + <stringProp name="parameters">${mobile_test}</stringProp> | ||
9498 | + <stringProp name="filename"></stringProp> | ||
9499 | + <stringProp name="script">import java.security.MessageDigest; | ||
9500 | +import java.util.Random; | ||
9501 | +String[] clientTypes = {"android","iphone"}; | ||
9502 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
9503 | +int rd = new Random().nextInt(2); | ||
9504 | +String clientType = clientTypes[rd]; | ||
9505 | +String privateKey = privateKeys[rd]; | ||
9506 | +String password = "HFCwrxLEBegZqq8OEZxwJQ=="; | ||
9507 | +String req = "app_version=6.0.0&client_type="+clientType+"&fromPage=iFP_NLogin&isSkip=N&method=sesame.flowering.higher&os_version=10.3.2&password="+password+"&physical_channel=1&private_key="+privateKey+"&profile="+bsh.args[0]+"&screen_size=375x667&shopping_key=&udid=4d08039b26ebafdea8f35336319bfdcd634029d3&uid=0&v=7"; | ||
9508 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
9509 | +byte[] btInput = req.getBytes(); | ||
9510 | +md.update(btInput); | ||
9511 | +byte[] btResult = md.digest(); | ||
9512 | +StringBuffer sb = new StringBuffer(); | ||
9513 | +for(byte b : btResult){ | ||
9514 | + int bt = b&0xff; | ||
9515 | + if(bt<16){ | ||
9516 | + sb.append(0); | ||
9517 | + } | ||
9518 | + sb.append(Integer.toHexString(bt)); | ||
9519 | +} | ||
9520 | +String md5 = sb.toString(); | ||
9521 | +password=URLEncoder.encode(password); | ||
9522 | +req = "app_version=6.0.0&client_type="+clientType+"&fromPage=iFP_NLogin&isSkip=N&method=sesame.flowering.higher&os_version=10.3.2&password="+password+"&physical_channel=1&private_key="+privateKey+"&profile="+bsh.args[0]+"&screen_size=375x667&shopping_key=&udid=4d08039b26ebafdea8f35336319bfdcd634029d3&uid=0&v=7"; | ||
9523 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
9524 | + </BeanShellPreProcessor> | ||
9525 | + <hashTree/> | ||
9526 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
9527 | + <collectionProp name="Asserion.test_strings"> | ||
9528 | + <stringProp name="1450572480">"code":200</stringProp> | ||
9529 | + </collectionProp> | ||
9530 | + <stringProp name="TestPlan.comments"></stringProp> | ||
9531 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
9532 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
9533 | + <intProp name="Assertion.test_type">16</intProp> | ||
9534 | + </ResponseAssertion> | ||
9535 | + <hashTree/> | ||
9536 | + </hashTree> | ||
9537 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
9538 | + <stringProp name="TestPlan.comments"></stringProp> | ||
9539 | + <doubleProp> | ||
9540 | + <name>throughput</name> | ||
9541 | + <value>600</value> | ||
9542 | + <savedValue>0.0</savedValue> | ||
9543 | + </doubleProp> | ||
9544 | + <intProp name="calcMode">2</intProp> | ||
9545 | + </ConstantThroughputTimer> | ||
9546 | + <hashTree/> | ||
9547 | + </hashTree> | ||
9450 | <BackendListener guiclass="BackendListenerGui" testclass="BackendListener" testname="influxdb_master" enabled="true"> | 9548 | <BackendListener guiclass="BackendListenerGui" testclass="BackendListener" testname="influxdb_master" enabled="true"> |
9451 | <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true"> | 9549 | <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true"> |
9452 | <collectionProp name="Arguments.arguments"> | 9550 | <collectionProp name="Arguments.arguments"> |
-
Please register or login to post a comment