|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<jmeterTestPlan version="1.2" properties="3.1" jmeter="3.1 r1770033">
|
|
|
<hashTree>
|
|
|
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="购物车编辑2" enabled="true">
|
|
|
<stringProp name="TestPlan.comments">YohoPerformanceTest_ThisScriptIsGeneratedByYPT</stringProp>
|
|
|
<boolProp name="TestPlan.functional_mode">false</boolProp>
|
|
|
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
|
|
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="TestPlan.user_define_classpath"></stringProp>
|
|
|
</TestPlan>
|
|
|
<hashTree>
|
|
|
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="header_JmeterTest" enabled="true">
|
|
|
<collectionProp name="HeaderManager.headers">
|
|
|
<elementProp name="" elementType="Header">
|
|
|
<stringProp name="Header.name">User-Agent</stringProp>
|
|
|
<stringProp name="Header.value">jmeter-test</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="" elementType="Header">
|
|
|
<stringProp name="Header.name">Accept-Encoding</stringProp>
|
|
|
<stringProp name="Header.value">gzip, deflate</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
</HeaderManager>
|
|
|
<hashTree/>
|
|
|
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="arguments_SNCP" enabled="true">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="SNCP" elementType="Argument">
|
|
|
<stringProp name="Argument.name">SNCP</stringProp>
|
|
|
<stringProp name="Argument.value">NGJjYjhkNmwwZGM0OTk0YmQyMTMwZjlmoTZmzjY4cjN</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments">通用session校验码</stringProp> </Arguments>
|
|
|
<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_uid_edit_5k" 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_edit,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_sku_edit_10" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<stringProp name="filename">/opt/jmeter/data/sku_edit.csv</stringProp>
|
|
|
<stringProp name="fileEncoding">utf-8</stringProp>
|
|
|
<stringProp name="variableNames">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/>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_cartEdit" 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>
|
|
|
<TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="tc_cartEdit" enabled="true">
|
|
|
<boolProp name="TransactionController.includeTimers">false</boolProp>
|
|
|
<boolProp name="TransactionController.parent">false</boolProp>
|
|
|
</TransactionController>
|
|
|
<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">${sku_edit} ${shopping_key_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 req = "app_version=5.8.0&buy_number=1&client_type="+clientType+"&edit_product_sku=0&goods_type=0&method=app.Shopping.add&os_version=yohobuy:web&private_key="+privateKey+"&product_sku="+bsh.args[0]+"&promotion_id=&screen_size=720x1280&selected=Y&session_key=5103fd2c7217459929865c1da6aa7f5a&shopping_key="+bsh.args[1]+"&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();
|
|
|
|
|
|
|
|
|
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>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_increase" 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">${sku_edit} ${shopping_key_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 req = "app_version=5.8.1&client_type="+clientType+"&fromPage=aFP_ShopCart&gender=1,3&increase_number=1&method=app.Shopping.increase&os_version=android4.3:R6007&physical_channel=1&private_key="+privateKey+"&product_sku="+bsh.args[0]+"&screen_size=720x1280&session_key=b8587bfb19e123bb56d3dabf1a5a80f7&shopping_key="+bsh.args[1]+"&udid=865852023421405a11b22ab89b6adb8&uid="+bsh.args[2]+"&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();
|
|
|
|
|
|
|
|
|
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>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_decrease" 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">${sku_edit} ${shopping_key_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 req = "app_version=5.8.0&client_type="+clientType+"&decrease_number=1&method=app.Shopping.decrease&os_version=yohobuy:web&private_key="+privateKey+"&product_sku="+bsh.args[0]+"&screen_size=720x1280&session_key=43aba1b5f35b3c978c4654bad2b638fa&shopping_key="+bsh.args[1]+"&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();
|
|
|
|
|
|
|
|
|
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>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_selectedAndQryCart_N" 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">${sku_edit} ${shopping_key_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 product_sku_list = "[{\"goods_type\":\"ordinary\",\"selected\":\"N\",\"product_sku\":"+bsh.args[0]+",\"promotion_id\":\"\",\"buy_number\":\"1\"}]";
|
|
|
String req = "app_version=5.9.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.selectedAndQryCart&os_version=yohobuy:h5&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&shopping_key="+bsh.args[1]+"&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();
|
|
|
product_sku_list=URLEncoder.encode(product_sku_list);
|
|
|
req = "app_version=5.9.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.selectedAndQryCart&os_version=yohobuy:h5&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&shopping_key="+bsh.args[1]+"&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>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_selectedAndQryCart_Y" 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">${sku_edit} ${shopping_key_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 product_sku_list = "[{\"goods_type\":\"ordinary\",\"selected\":\"Y\",\"product_sku\":"+bsh.args[0]+",\"promotion_id\":\"\",\"buy_number\":\"1\"}]";
|
|
|
String req = "app_version=5.9.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.selectedAndQryCart&os_version=yohobuy:h5&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&shopping_key="+bsh.args[1]+"&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();
|
|
|
product_sku_list=URLEncoder.encode(product_sku_list);
|
|
|
req = "app_version=5.9.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.selectedAndQryCart&os_version=yohobuy:h5&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=00ed65eb36a474388df2fa2d6e97a8a5&shopping_key="+bsh.args[1]+"&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>
|
|
|
<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">${sku_edit} ${shopping_key_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 product_sku_list = "[{\"product_sku\":"+bsh.args[0]+",\"buy_number\":1,\"promotion_id\":0}]";
|
|
|
String req = "app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.removeAndQryCart&os_version=yohobuy:web&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=ee6f3430e10c933810a7bf78576bfb47&shopping_key="+bsh.args[1]+"&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();
|
|
|
product_sku_list=URLEncoder.encode(product_sku_list);
|
|
|
req = "app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.removeAndQryCart&os_version=yohobuy:web&private_key="+privateKey+"&product_sku_list="+product_sku_list+"&screen_size=720x1280&session_key=ee6f3430e10c933810a7bf78576bfb47&shopping_key="+bsh.args[1]+"&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>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>3600</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<BackendListener guiclass="BackendListenerGui" testclass="BackendListener" testname="influxdb_master" enabled="true">
|
|
|
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="graphiteMetricsSender" elementType="Argument">
|
|
|
<stringProp name="Argument.name">graphiteMetricsSender</stringProp>
|
|
|
<stringProp name="Argument.value">org.apache.jmeter.visualizers.backend.graphite.TextGraphiteMetricsSender</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="graphiteHost" elementType="Argument">
|
|
|
<stringProp name="Argument.name">graphiteHost</stringProp>
|
|
|
<stringProp name="Argument.value">192.168.104.43</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="graphitePort" elementType="Argument">
|
|
|
<stringProp name="Argument.name">graphitePort</stringProp>
|
|
|
<stringProp name="Argument.value">2003</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="rootMetricsPrefix" elementType="Argument">
|
|
|
<stringProp name="Argument.name">rootMetricsPrefix</stringProp>
|
|
|
<stringProp name="Argument.value">${__machineIP()}.</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="summaryOnly" elementType="Argument">
|
|
|
<stringProp name="Argument.name">summaryOnly</stringProp>
|
|
|
<stringProp name="Argument.value">false</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="samplersList" elementType="Argument">
|
|
|
<stringProp name="Argument.name">samplersList</stringProp>
|
|
|
<stringProp name="Argument.value">tc_.*</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="useRegexpForSamplersList" elementType="Argument">
|
|
|
<stringProp name="Argument.name">useRegexpForSamplersList</stringProp>
|
|
|
<stringProp name="Argument.value">true</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
<elementProp name="percentiles" elementType="Argument">
|
|
|
<stringProp name="Argument.name">percentiles</stringProp>
|
|
|
<stringProp name="Argument.value">90</stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="classname">org.apache.jmeter.visualizers.backend.graphite.GraphiteBackendListenerClient</stringProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
</BackendListener>
|
|
|
<hashTree/> </hashTree>
|
|
|
</hashTree>
|
|
|
</jmeterTestPlan> |
|
|
\ No newline at end of file |
...
|
...
|
|