...
|
...
|
@@ -22,6 +22,16 @@ |
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments">通用session校验码</stringProp> </Arguments>
|
|
|
<hashTree/>
|
|
|
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="arguments_TMP" enabled="true">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="HOST_API" elementType="Argument">
|
|
|
<stringProp name="Argument.name">HOST_API</stringProp>
|
|
|
<stringProp name="Argument.value">api-test3.yohops.com:9999</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp> </Arguments>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_10w" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/uid_mobile_openid.csv</stringProp>
|
...
|
...
|
@@ -34,265 +44,23 @@ |
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_hosts_pt" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/hosts_pt.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">HOST_API,HOST_SERVICE</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_商品for浏览" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/product_2w.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">product_id,product_skn</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_品牌数据" enabled="true">
|
|
|
<stringProp name="TestPlan.comments">品牌数据</stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/brand.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">brand_id</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_购物车查询" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/cart_query.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">cart_uid,cart_shopping_key,unuser_promotion_id</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_逛" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/guang.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">article_id,article_author_id,article_datetime</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_订单" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/order_code.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">order_code,order_uid</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_cart_edit_5k_2" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/uid_cart_edit.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">uid,address_id_edit,shopping_key_edit,coupon_code_1_edit,coupon_code_2_edit</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_品牌关联" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/brandRelation.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">brandRelationId</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_促销id" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/promotion_id.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">cart_promotion_id</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_test_1w" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/uid_mobile_openid_test.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">uid_test,mobile_test,open_id_test</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_sku_edit_25w" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/uid_sku_edit.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">uid_edit,address_id_edit,coupon_code_edit,sku_edit</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_sku_submit_25w" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/uid_sku_submit.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">uid_submit,address_id_submit,coupon_code_submit,sku_submit</stringProp>
|
|
|
<stringProp name="delimiter">,</stringProp>
|
|
|
<boolProp name="quotedData">false</boolProp>
|
|
|
<boolProp name="recycle">true</boolProp>
|
|
|
<boolProp name="stopThread">false</boolProp>
|
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_queryCart" enabled="true">
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_drawline_addQueue" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">10</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">查询用户购物车</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_queryCart" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">查询用户购物车</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${cart_uid}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"};
|
|
|
int rd = new Random().nextInt(1);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:web";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_queryPromotionGifts" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">加价购促销商品列表</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_queryPromotionGifts" enabled="true">
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_drawline_addQueue" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
...
|
...
|
@@ -317,23 +85,23 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri |
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">加价购促销商品列表</stringProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${cart_promotion_id} ${cart_uid}</stringProp>
|
|
|
<stringProp name="parameters">${uid}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"};
|
|
|
int rd = new Random().nextInt(1);
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "android5.1:HUAWEI_TAG-TL00";
|
|
|
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";
|
|
|
String os_version = "android6.0.1:MI_4LTE";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
...
|
...
|
@@ -348,1089 +116,7 @@ for(byte b : btResult){ |
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_add_edit" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">添加购物车</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_add_edit" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">添加购物车</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${sku_edit} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:web";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_removeAndQryCart" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">删除并查询购物车</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_removeAndQryCart" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">删除并查询购物车</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${sku_edit} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:web";
|
|
|
String product_sku_list = "[{\"product_sku\":"+bsh.args[1]+",\"buy_number\":1,\"promotion_id\":0}]";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
product_sku_list=URLEncoder.encode(product_sku_list);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_selectedAndQryCart_single" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_selectedAndQryCart_single" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${__RandomString(1,YN,)} ${sku_edit} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:h5";
|
|
|
String product_sku_list = "[{\"goods_type\":\"ordinary\",\"selected\":\""+bsh.args[1]+"\",\"product_sku\":"+bsh.args[2]+",\"promotion_id\":\"\",\"buy_number\":\"1\"}]";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
product_sku_list=URLEncoder.encode(product_sku_list);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_payment" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">结算</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_payment" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">结算</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:h5";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_address_get" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">获取地址</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_address_get" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">获取地址</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
|
|
|
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_countUsableCoupon" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">可用优惠券数量(是否可降级)</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_countUsableCoupon" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">可用优惠券数量(是否可降级)</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
|
|
|
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_compute" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">计算</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_compute" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">计算</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${coupon_code_edit} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:h5";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_useCoupon" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">使用优惠券</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_useCoupon" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">使用优惠券</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${coupon_code_edit} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "yohobuy:h5";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_listCoupon" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">购物车优惠卷列表</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_listCoupon" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">购物车优惠卷列表</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
|
|
|
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_payment_findPayListDetail" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">支付列表信息</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_payment_findPayListDetail" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">支付列表信息</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${uid_submit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
String os_version = "android5.0.2:vivo_Y33";
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
os_version=URLEncoder.encode(os_version);
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_recommend_purchased" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">买了再买功能</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_recommend_purchased" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">买了再买功能</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${SNCP} ${product_skn} ${uid_edit}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"android","iphone"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"};
|
|
|
int rd = new Random().nextInt(2);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
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";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5 = sb.toString();
|
|
|
|
|
|
|
|
|
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";
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
...
|
...
|
|