Showing
1 changed file
with
873 additions
and
24 deletions
@@ -12,6 +12,16 @@ | @@ -12,6 +12,16 @@ | ||
12 | <stringProp name="TestPlan.user_define_classpath"></stringProp> | 12 | <stringProp name="TestPlan.user_define_classpath"></stringProp> |
13 | </TestPlan> | 13 | </TestPlan> |
14 | <hashTree> | 14 | <hashTree> |
15 | + <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="arguments_SNCP" enabled="true"> | ||
16 | + <collectionProp name="Arguments.arguments"> | ||
17 | + <elementProp name="SNCP" elementType="Argument"> | ||
18 | + <stringProp name="Argument.name">SNCP</stringProp> | ||
19 | + <stringProp name="Argument.value">NGJjYjhkNmwwZGM0OTk0YmQyMTMwZjlmoTZmzjY4cjN</stringProp> | ||
20 | + <stringProp name="Argument.metadata">=</stringProp> | ||
21 | + </elementProp> | ||
22 | + </collectionProp> | ||
23 | + <stringProp name="TestPlan.comments">通用session校验码</stringProp> </Arguments> | ||
24 | + <hashTree/> | ||
15 | <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_hosts_pt" enabled="true"> | 25 | <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_hosts_pt" enabled="true"> |
16 | <stringProp name="TestPlan.comments"></stringProp> | 26 | <stringProp name="TestPlan.comments"></stringProp> |
17 | <stringProp name="filename">/opt/jmeter/data/hosts_pt.csv</stringProp> | 27 | <stringProp name="filename">/opt/jmeter/data/hosts_pt.csv</stringProp> |
@@ -24,11 +34,47 @@ | @@ -24,11 +34,47 @@ | ||
24 | <stringProp name="shareMode">shareMode.all</stringProp> | 34 | <stringProp name="shareMode">shareMode.all</stringProp> |
25 | </CSVDataSet> | 35 | </CSVDataSet> |
26 | <hashTree/> | 36 | <hashTree/> |
27 | - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_sku_edit_25w" enabled="true"> | 37 | + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_商品for浏览" enabled="true"> |
38 | + <stringProp name="TestPlan.comments"></stringProp> | ||
39 | + <stringProp name="filename">/opt/jmeter/data/product_2w.csv</stringProp> | ||
40 | + <stringProp name="fileEncoding">utf-8</stringProp> | ||
41 | + <stringProp name="variableNames">product_id,product_skn</stringProp> | ||
42 | + <stringProp name="delimiter">,</stringProp> | ||
43 | + <boolProp name="quotedData">false</boolProp> | ||
44 | + <boolProp name="recycle">true</boolProp> | ||
45 | + <boolProp name="stopThread">false</boolProp> | ||
46 | + <stringProp name="shareMode">shareMode.all</stringProp> | ||
47 | + </CSVDataSet> | ||
48 | + <hashTree/> | ||
49 | + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_品牌数据" enabled="true"> | ||
50 | + <stringProp name="TestPlan.comments">品牌数据</stringProp> | ||
51 | + <stringProp name="filename">/opt/jmeter/data/brand.csv</stringProp> | ||
52 | + <stringProp name="fileEncoding">utf-8</stringProp> | ||
53 | + <stringProp name="variableNames">brand_id</stringProp> | ||
54 | + <stringProp name="delimiter">,</stringProp> | ||
55 | + <boolProp name="quotedData">false</boolProp> | ||
56 | + <boolProp name="recycle">true</boolProp> | ||
57 | + <boolProp name="stopThread">false</boolProp> | ||
58 | + <stringProp name="shareMode">shareMode.all</stringProp> | ||
59 | + </CSVDataSet> | ||
60 | + <hashTree/> | ||
61 | + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_店铺" enabled="true"> | ||
62 | + <stringProp name="TestPlan.comments"></stringProp> | ||
63 | + <stringProp name="filename">/opt/jmeter/data/shops.csv</stringProp> | ||
64 | + <stringProp name="fileEncoding">utf-8</stringProp> | ||
65 | + <stringProp name="variableNames">shop_id,shop_domain</stringProp> | ||
66 | + <stringProp name="delimiter">,</stringProp> | ||
67 | + <boolProp name="quotedData">false</boolProp> | ||
68 | + <boolProp name="recycle">true</boolProp> | ||
69 | + <boolProp name="stopThread">false</boolProp> | ||
70 | + <stringProp name="shareMode">shareMode.all</stringProp> | ||
71 | + </CSVDataSet> | ||
72 | + <hashTree/> | ||
73 | + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="data_uid_mobile_openid_test_1w" enabled="true"> | ||
28 | <stringProp name="TestPlan.comments"></stringProp> | 74 | <stringProp name="TestPlan.comments"></stringProp> |
29 | - <stringProp name="filename">/opt/jmeter/data/uid_sku_edit.csv</stringProp> | 75 | + <stringProp name="filename">/opt/jmeter/data/uid_mobile_openid_test.csv</stringProp> |
30 | <stringProp name="fileEncoding">utf-8</stringProp> | 76 | <stringProp name="fileEncoding">utf-8</stringProp> |
31 | - <stringProp name="variableNames">uid_edit,sku_edit</stringProp> | 77 | + <stringProp name="variableNames">uid_test,mobile_test,open_id_test</stringProp> |
32 | <stringProp name="delimiter">,</stringProp> | 78 | <stringProp name="delimiter">,</stringProp> |
33 | <boolProp name="quotedData">false</boolProp> | 79 | <boolProp name="quotedData">false</boolProp> |
34 | <boolProp name="recycle">true</boolProp> | 80 | <boolProp name="recycle">true</boolProp> |
@@ -36,13 +82,13 @@ | @@ -36,13 +82,13 @@ | ||
36 | <stringProp name="shareMode">shareMode.all</stringProp> | 82 | <stringProp name="shareMode">shareMode.all</stringProp> |
37 | </CSVDataSet> | 83 | </CSVDataSet> |
38 | <hashTree/> | 84 | <hashTree/> |
39 | - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_test" enabled="true"> | 85 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_invitecode_my" enabled="true"> |
40 | <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | 86 | <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> |
41 | <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | 87 | <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> |
42 | <boolProp name="LoopController.continue_forever">false</boolProp> | 88 | <boolProp name="LoopController.continue_forever">false</boolProp> |
43 | <intProp name="LoopController.loops">-1</intProp> | 89 | <intProp name="LoopController.loops">-1</intProp> |
44 | </elementProp> | 90 | </elementProp> |
45 | - <stringProp name="ThreadGroup.num_threads">10</stringProp> | 91 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> |
46 | <stringProp name="ThreadGroup.ramp_time">10</stringProp> | 92 | <stringProp name="ThreadGroup.ramp_time">10</stringProp> |
47 | <longProp name="ThreadGroup.start_time">1488865571000</longProp> | 93 | <longProp name="ThreadGroup.start_time">1488865571000</longProp> |
48 | <longProp name="ThreadGroup.end_time">1488865571000</longProp> | 94 | <longProp name="ThreadGroup.end_time">1488865571000</longProp> |
@@ -52,12 +98,105 @@ | @@ -52,12 +98,105 @@ | ||
52 | <stringProp name="TestPlan.comments"></stringProp> | 98 | <stringProp name="TestPlan.comments"></stringProp> |
53 | </ThreadGroup> | 99 | </ThreadGroup> |
54 | <hashTree> | 100 | <hashTree> |
55 | -<TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="tc_test" enabled="true"> | ||
56 | - <boolProp name="TransactionController.includeTimers">false</boolProp> | ||
57 | - <boolProp name="TransactionController.parent">false</boolProp> | ||
58 | - </TransactionController> | 101 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_invitecode_my" enabled="true"> |
102 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
103 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
104 | + <collectionProp name="Arguments.arguments"> | ||
105 | + <elementProp name="" elementType="HTTPArgument"> | ||
106 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
107 | + <stringProp name="Argument.value"></stringProp> | ||
108 | + <stringProp name="Argument.metadata">=</stringProp> | ||
109 | + </elementProp> | ||
110 | + </collectionProp> | ||
111 | + </elementProp> | ||
112 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
113 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
114 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
115 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
116 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
117 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
118 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
119 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
120 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
121 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
122 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
123 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
124 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
125 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
126 | + <stringProp name="TestPlan.comments"></stringProp> | ||
127 | + </HTTPSamplerProxy> | ||
128 | + <hashTree> | ||
129 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
130 | + <stringProp name="TestPlan.comments"></stringProp> | ||
131 | + <boolProp name="resetInterpreter">false</boolProp> | ||
132 | + <stringProp name="parameters">${uid_test}</stringProp> | ||
133 | + <stringProp name="filename"></stringProp> | ||
134 | + <stringProp name="script">import java.security.MessageDigest; | ||
135 | +import java.util.Random; | ||
136 | +String[] clientTypes = {"android","iphone"}; | ||
137 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
138 | +int rd = new Random().nextInt(2); | ||
139 | +String clientType = clientTypes[rd]; | ||
140 | +String privateKey = privateKeys[rd]; | ||
141 | +String os_version = "android7.0:MHA-AL00"; | ||
142 | +String req = "app_version=6.0.0&client_type="+clientType+"&gender=1,3&method=app.invitecode.my&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1812&session_key=81db9b0189c8709e1197fbbe46e1bf1b&udid=86071803186890029c9419df7fdcc2&uid="+bsh.args[0]+"&v=7&yh_channel=1"; | ||
143 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
144 | +byte[] btInput = req.getBytes(); | ||
145 | +md.update(btInput); | ||
146 | +byte[] btResult = md.digest(); | ||
147 | +StringBuffer sb = new StringBuffer(); | ||
148 | +for(byte b : btResult){ | ||
149 | + int bt = b&0xff; | ||
150 | + if(bt<16){ | ||
151 | + sb.append(0); | ||
152 | + } | ||
153 | + sb.append(Integer.toHexString(bt)); | ||
154 | +} | ||
155 | +String md5 = sb.toString(); | ||
156 | +os_version=URLEncoder.encode(os_version); | ||
157 | +req = "app_version=6.0.0&client_type="+clientType+"&gender=1,3&method=app.invitecode.my&os_version="+os_version+"&physical_channel=1&private_key="+privateKey+"&screen_size=1080x1812&session_key=81db9b0189c8709e1197fbbe46e1bf1b&udid=86071803186890029c9419df7fdcc2&uid="+bsh.args[0]+"&v=7&yh_channel=1"; | ||
158 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
159 | + </BeanShellPreProcessor> | ||
160 | + <hashTree/> | ||
161 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
162 | + <collectionProp name="Asserion.test_strings"> | ||
163 | + <stringProp name="1450572480">"code":200</stringProp> | ||
164 | + </collectionProp> | ||
165 | + <stringProp name="TestPlan.comments"></stringProp> | ||
166 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
167 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
168 | + <intProp name="Assertion.test_type">16</intProp> | ||
169 | + </ResponseAssertion> | ||
170 | + <hashTree/> | ||
171 | + </hashTree> | ||
172 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
173 | + <stringProp name="TestPlan.comments"></stringProp> | ||
174 | + <doubleProp> | ||
175 | + <name>throughput</name> | ||
176 | + <value>600</value> | ||
177 | + <savedValue>0.0</savedValue> | ||
178 | + </doubleProp> | ||
179 | + <intProp name="calcMode">2</intProp> | ||
180 | + </ConstantThroughputTimer> | ||
181 | + <hashTree/> | ||
182 | + </hashTree> | ||
183 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_activity_template" enabled="true"> | ||
184 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
185 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
186 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
187 | + <intProp name="LoopController.loops">-1</intProp> | ||
188 | + </elementProp> | ||
189 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
190 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
191 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
192 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
193 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
194 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
195 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
196 | + <stringProp name="TestPlan.comments">活动模板</stringProp> | ||
197 | + </ThreadGroup> | ||
59 | <hashTree> | 198 | <hashTree> |
60 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_add_edit" enabled="true"> | 199 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_activity_template" enabled="true"> |
61 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | 200 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> |
62 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | 201 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> |
63 | <collectionProp name="Arguments.arguments"> | 202 | <collectionProp name="Arguments.arguments"> |
@@ -82,13 +221,13 @@ | @@ -82,13 +221,13 @@ | ||
82 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | 221 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> |
83 | <boolProp name="HTTPSampler.monitor">false</boolProp> | 222 | <boolProp name="HTTPSampler.monitor">false</boolProp> |
84 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | 223 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> |
85 | - <stringProp name="TestPlan.comments">添加购物车</stringProp> | 224 | + <stringProp name="TestPlan.comments">活动模板</stringProp> |
86 | </HTTPSamplerProxy> | 225 | </HTTPSamplerProxy> |
87 | <hashTree> | 226 | <hashTree> |
88 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | 227 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> |
89 | <stringProp name="TestPlan.comments"></stringProp> | 228 | <stringProp name="TestPlan.comments"></stringProp> |
90 | <boolProp name="resetInterpreter">false</boolProp> | 229 | <boolProp name="resetInterpreter">false</boolProp> |
91 | - <stringProp name="parameters">${sku_edit} ${uid_edit}</stringProp> | 230 | + <stringProp name="parameters"></stringProp> |
92 | <stringProp name="filename"></stringProp> | 231 | <stringProp name="filename"></stringProp> |
93 | <stringProp name="script">import java.security.MessageDigest; | 232 | <stringProp name="script">import java.security.MessageDigest; |
94 | import java.util.Random; | 233 | import java.util.Random; |
@@ -97,8 +236,106 @@ String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb | @@ -97,8 +236,106 @@ String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb | ||
97 | int rd = new Random().nextInt(2); | 236 | int rd = new Random().nextInt(2); |
98 | String clientType = clientTypes[rd]; | 237 | String clientType = clientTypes[rd]; |
99 | String privateKey = privateKeys[rd]; | 238 | String privateKey = privateKeys[rd]; |
100 | -String os_version = "yohobuy:web"; | ||
101 | -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="+os_version+"&private_key="+privateKey+"&product_sku="+bsh.args[0]+"&promotion_id=&screen_size=720x1280&selected=Y&session_key=5103fd2c7217459929865c1da6aa7f5a&shopping_key=0&uid="+bsh.args[1]+"&v=7"; | 239 | +String os_version = "yohobuy:h5"; |
240 | +String req = "activity_id=483&app_version=6.0.1&client_type="+clientType+"&method=app.activity.template&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&v=7"; | ||
241 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
242 | +byte[] btInput = req.getBytes(); | ||
243 | +md.update(btInput); | ||
244 | +byte[] btResult = md.digest(); | ||
245 | +StringBuffer sb = new StringBuffer(); | ||
246 | +for(byte b : btResult){ | ||
247 | + int bt = b&0xff; | ||
248 | + if(bt<16){ | ||
249 | + sb.append(0); | ||
250 | + } | ||
251 | + sb.append(Integer.toHexString(bt)); | ||
252 | +} | ||
253 | +String md5 = sb.toString(); | ||
254 | +os_version=URLEncoder.encode(os_version); | ||
255 | +req = "activity_id=483&app_version=6.0.1&client_type="+clientType+"&method=app.activity.template&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&v=7"; | ||
256 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
257 | + </BeanShellPreProcessor> | ||
258 | + <hashTree/> | ||
259 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
260 | + <collectionProp name="Asserion.test_strings"> | ||
261 | + <stringProp name="1450572480">"code":200</stringProp> | ||
262 | + </collectionProp> | ||
263 | + <stringProp name="TestPlan.comments"></stringProp> | ||
264 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
265 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
266 | + <intProp name="Assertion.test_type">16</intProp> | ||
267 | + </ResponseAssertion> | ||
268 | + <hashTree/> | ||
269 | + </hashTree> | ||
270 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
271 | + <stringProp name="TestPlan.comments"></stringProp> | ||
272 | + <doubleProp> | ||
273 | + <name>throughput</name> | ||
274 | + <value>600</value> | ||
275 | + <savedValue>0.0</savedValue> | ||
276 | + </doubleProp> | ||
277 | + <intProp name="calcMode">2</intProp> | ||
278 | + </ConstantThroughputTimer> | ||
279 | + <hashTree/> | ||
280 | + </hashTree> | ||
281 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_coupons_queryFreePostCoupons" enabled="true"> | ||
282 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
283 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
284 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
285 | + <intProp name="LoopController.loops">-1</intProp> | ||
286 | + </elementProp> | ||
287 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
288 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
289 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
290 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
291 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
292 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
293 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
294 | + <stringProp name="TestPlan.comments"></stringProp> | ||
295 | + </ThreadGroup> | ||
296 | + <hashTree> | ||
297 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_coupons_queryFreePostCoupons" enabled="true"> | ||
298 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
299 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
300 | + <collectionProp name="Arguments.arguments"> | ||
301 | + <elementProp name="" elementType="HTTPArgument"> | ||
302 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
303 | + <stringProp name="Argument.value"></stringProp> | ||
304 | + <stringProp name="Argument.metadata">=</stringProp> | ||
305 | + </elementProp> | ||
306 | + </collectionProp> | ||
307 | + </elementProp> | ||
308 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
309 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
310 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
311 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
312 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
313 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
314 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
315 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
316 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
317 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
318 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
319 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
320 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
321 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
322 | + <stringProp name="TestPlan.comments"></stringProp> | ||
323 | + </HTTPSamplerProxy> | ||
324 | + <hashTree> | ||
325 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
326 | + <stringProp name="TestPlan.comments"></stringProp> | ||
327 | + <boolProp name="resetInterpreter">false</boolProp> | ||
328 | + <stringProp name="parameters">${uid_test}</stringProp> | ||
329 | + <stringProp name="filename"></stringProp> | ||
330 | + <stringProp name="script">import java.security.MessageDigest; | ||
331 | +import java.util.Random; | ||
332 | +String[] clientTypes = {"iphone"}; | ||
333 | +String[] privateKeys = {"a85bb0674e08986c6b115d5e3a4884fa"}; | ||
334 | +int rd = new Random().nextInt(1); | ||
335 | +String clientType = clientTypes[rd]; | ||
336 | +String privateKey = privateKeys[rd]; | ||
337 | +String os_version = "yohobuy:h5"; | ||
338 | +String req = "app_version=6.0.0&client_type="+clientType+"&method=app.coupons.queryFreePostCoupons&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=5ad38285596e864149a00096773691b3&session_type=iphone&uid="+bsh.args[0]+"&v=7"; | ||
102 | MessageDigest md = MessageDigest.getInstance("MD5"); | 339 | MessageDigest md = MessageDigest.getInstance("MD5"); |
103 | byte[] btInput = req.getBytes(); | 340 | byte[] btInput = req.getBytes(); |
104 | md.update(btInput); | 341 | md.update(btInput); |
@@ -113,7 +350,7 @@ for(byte b : btResult){ | @@ -113,7 +350,7 @@ for(byte b : btResult){ | ||
113 | } | 350 | } |
114 | String md5 = sb.toString(); | 351 | String md5 = sb.toString(); |
115 | os_version=URLEncoder.encode(os_version); | 352 | os_version=URLEncoder.encode(os_version); |
116 | -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="+os_version+"&private_key="+privateKey+"&product_sku="+bsh.args[0]+"&promotion_id=&screen_size=720x1280&selected=Y&session_key=5103fd2c7217459929865c1da6aa7f5a&shopping_key=0&uid="+bsh.args[1]+"&v=7"; | 353 | +req = "app_version=6.0.0&client_type="+clientType+"&method=app.coupons.queryFreePostCoupons&os_version="+os_version+"&private_key="+privateKey+"&screen_size=720x1280&session_key=5ad38285596e864149a00096773691b3&session_type=iphone&uid="+bsh.args[0]+"&v=7"; |
117 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | 354 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> |
118 | </BeanShellPreProcessor> | 355 | </BeanShellPreProcessor> |
119 | <hashTree/> | 356 | <hashTree/> |
@@ -128,7 +365,34 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | @@ -128,7 +365,34 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | ||
128 | </ResponseAssertion> | 365 | </ResponseAssertion> |
129 | <hashTree/> | 366 | <hashTree/> |
130 | </hashTree> | 367 | </hashTree> |
131 | - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_removeAndQryCart" enabled="true"> | 368 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> |
369 | + <stringProp name="TestPlan.comments"></stringProp> | ||
370 | + <doubleProp> | ||
371 | + <name>throughput</name> | ||
372 | + <value>600</value> | ||
373 | + <savedValue>0.0</savedValue> | ||
374 | + </doubleProp> | ||
375 | + <intProp name="calcMode">2</intProp> | ||
376 | + </ConstantThroughputTimer> | ||
377 | + <hashTree/> | ||
378 | + </hashTree> | ||
379 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_product_refundExchange" enabled="true"> | ||
380 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
381 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
382 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
383 | + <intProp name="LoopController.loops">-1</intProp> | ||
384 | + </elementProp> | ||
385 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
386 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
387 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
388 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
389 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
390 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
391 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
392 | + <stringProp name="TestPlan.comments"></stringProp> | ||
393 | + </ThreadGroup> | ||
394 | + <hashTree> | ||
395 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_product_refundExchange" enabled="true"> | ||
132 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | 396 | <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> |
133 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | 397 | <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> |
134 | <collectionProp name="Arguments.arguments"> | 398 | <collectionProp name="Arguments.arguments"> |
@@ -153,13 +417,13 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | @@ -153,13 +417,13 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | ||
153 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | 417 | <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> |
154 | <boolProp name="HTTPSampler.monitor">false</boolProp> | 418 | <boolProp name="HTTPSampler.monitor">false</boolProp> |
155 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | 419 | <stringProp name="HTTPSampler.embedded_url_re"></stringProp> |
156 | - <stringProp name="TestPlan.comments">删除并查询购物车</stringProp> | 420 | + <stringProp name="TestPlan.comments"></stringProp> |
157 | </HTTPSamplerProxy> | 421 | </HTTPSamplerProxy> |
158 | <hashTree> | 422 | <hashTree> |
159 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | 423 | <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> |
160 | <stringProp name="TestPlan.comments"></stringProp> | 424 | <stringProp name="TestPlan.comments"></stringProp> |
161 | <boolProp name="resetInterpreter">false</boolProp> | 425 | <boolProp name="resetInterpreter">false</boolProp> |
162 | - <stringProp name="parameters">${sku_edit} ${uid_edit}</stringProp> | 426 | + <stringProp name="parameters">${product_skn}</stringProp> |
163 | <stringProp name="filename"></stringProp> | 427 | <stringProp name="filename"></stringProp> |
164 | <stringProp name="script">import java.security.MessageDigest; | 428 | <stringProp name="script">import java.security.MessageDigest; |
165 | import java.util.Random; | 429 | import java.util.Random; |
@@ -169,8 +433,7 @@ int rd = new Random().nextInt(2); | @@ -169,8 +433,7 @@ int rd = new Random().nextInt(2); | ||
169 | String clientType = clientTypes[rd]; | 433 | String clientType = clientTypes[rd]; |
170 | String privateKey = privateKeys[rd]; | 434 | String privateKey = privateKeys[rd]; |
171 | String os_version = "yohobuy:web"; | 435 | String os_version = "yohobuy:web"; |
172 | -String product_sku_list = "[{\"product_sku\":"+bsh.args[0]+",\"buy_number\":1,\"promotion_id\":0}]"; | ||
173 | -String req = "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[1]+"&v=7"; | 436 | +String req = "app_version=5.8.0&client_type="+clientType+"&method=web.product.refundExchange&os_version="+os_version+"&private_key="+privateKey+"&product_skn="+bsh.args[0]+"&screen_size=720x1280&v=7"; |
174 | MessageDigest md = MessageDigest.getInstance("MD5"); | 437 | MessageDigest md = MessageDigest.getInstance("MD5"); |
175 | byte[] btInput = req.getBytes(); | 438 | byte[] btInput = req.getBytes(); |
176 | md.update(btInput); | 439 | md.update(btInput); |
@@ -185,8 +448,595 @@ for(byte b : btResult){ | @@ -185,8 +448,595 @@ for(byte b : btResult){ | ||
185 | } | 448 | } |
186 | String md5 = sb.toString(); | 449 | String md5 = sb.toString(); |
187 | os_version=URLEncoder.encode(os_version); | 450 | os_version=URLEncoder.encode(os_version); |
188 | -product_sku_list=URLEncoder.encode(product_sku_list); | ||
189 | -req = "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[1]+"&v=7"; | 451 | +req = "app_version=5.8.0&client_type="+clientType+"&method=web.product.refundExchange&os_version="+os_version+"&private_key="+privateKey+"&product_skn="+bsh.args[0]+"&screen_size=720x1280&v=7"; |
452 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
453 | + </BeanShellPreProcessor> | ||
454 | + <hashTree/> | ||
455 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
456 | + <collectionProp name="Asserion.test_strings"> | ||
457 | + <stringProp name="1450572480">"code":200</stringProp> | ||
458 | + </collectionProp> | ||
459 | + <stringProp name="TestPlan.comments"></stringProp> | ||
460 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
461 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
462 | + <intProp name="Assertion.test_type">16</intProp> | ||
463 | + </ResponseAssertion> | ||
464 | + <hashTree/> | ||
465 | + </hashTree> | ||
466 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
467 | + <stringProp name="TestPlan.comments"></stringProp> | ||
468 | + <doubleProp> | ||
469 | + <name>throughput</name> | ||
470 | + <value>600</value> | ||
471 | + <savedValue>0.0</savedValue> | ||
472 | + </doubleProp> | ||
473 | + <intProp name="calcMode">2</intProp> | ||
474 | + </ConstantThroughputTimer> | ||
475 | + <hashTree/> | ||
476 | + </hashTree> | ||
477 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_product_shopPreference" enabled="true"> | ||
478 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
479 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
480 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
481 | + <intProp name="LoopController.loops">-1</intProp> | ||
482 | + </elementProp> | ||
483 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
484 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
485 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
486 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
487 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
488 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
489 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
490 | + <stringProp name="TestPlan.comments">跨店铺推荐商品列表</stringProp> | ||
491 | + </ThreadGroup> | ||
492 | + <hashTree> | ||
493 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_product_shopPreference" enabled="true"> | ||
494 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
495 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
496 | + <collectionProp name="Arguments.arguments"> | ||
497 | + <elementProp name="" elementType="HTTPArgument"> | ||
498 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
499 | + <stringProp name="Argument.value"></stringProp> | ||
500 | + <stringProp name="Argument.metadata">=</stringProp> | ||
501 | + </elementProp> | ||
502 | + </collectionProp> | ||
503 | + </elementProp> | ||
504 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
505 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
506 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
507 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
508 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
509 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
510 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
511 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
512 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
513 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
514 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
515 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
516 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
517 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
518 | + <stringProp name="TestPlan.comments">跨店铺推荐商品列表</stringProp> | ||
519 | + </HTTPSamplerProxy> | ||
520 | + <hashTree> | ||
521 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
522 | + <stringProp name="TestPlan.comments"></stringProp> | ||
523 | + <boolProp name="resetInterpreter">false</boolProp> | ||
524 | + <stringProp name="parameters">${brand_id} ${product_skn} ${shop_id}</stringProp> | ||
525 | + <stringProp name="filename"></stringProp> | ||
526 | + <stringProp name="script">import java.security.MessageDigest; | ||
527 | +import java.util.Random; | ||
528 | +String[] clientTypes = {"android","iphone"}; | ||
529 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
530 | +int rd = new Random().nextInt(2); | ||
531 | +String clientType = clientTypes[rd]; | ||
532 | +String privateKey = privateKeys[rd]; | ||
533 | + | ||
534 | +String req = "brandId="+bsh.args[0]+"&client_type="+clientType+"&limit=30&method=app.product.shopPreference&private_key="+privateKey+"&product_skn="+bsh.args[1]+"&shopId="+bsh.args[2]+"&yh_channel=1"; | ||
535 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
536 | +byte[] btInput = req.getBytes(); | ||
537 | +md.update(btInput); | ||
538 | +byte[] btResult = md.digest(); | ||
539 | +StringBuffer sb = new StringBuffer(); | ||
540 | +for(byte b : btResult){ | ||
541 | + int bt = b&0xff; | ||
542 | + if(bt<16){ | ||
543 | + sb.append(0); | ||
544 | + } | ||
545 | + sb.append(Integer.toHexString(bt)); | ||
546 | +} | ||
547 | +String md5 = sb.toString(); | ||
548 | + | ||
549 | + | ||
550 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
551 | + </BeanShellPreProcessor> | ||
552 | + <hashTree/> | ||
553 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
554 | + <collectionProp name="Asserion.test_strings"> | ||
555 | + <stringProp name="1450572480">"code":200</stringProp> | ||
556 | + </collectionProp> | ||
557 | + <stringProp name="TestPlan.comments"></stringProp> | ||
558 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
559 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
560 | + <intProp name="Assertion.test_type">16</intProp> | ||
561 | + </ResponseAssertion> | ||
562 | + <hashTree/> | ||
563 | + </hashTree> | ||
564 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
565 | + <stringProp name="TestPlan.comments"></stringProp> | ||
566 | + <doubleProp> | ||
567 | + <name>throughput</name> | ||
568 | + <value>600</value> | ||
569 | + <savedValue>0.0</savedValue> | ||
570 | + </doubleProp> | ||
571 | + <intProp name="calcMode">2</intProp> | ||
572 | + </ConstantThroughputTimer> | ||
573 | + <hashTree/> | ||
574 | + </hashTree> | ||
575 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_resources_config_syncAppDegrade" enabled="true"> | ||
576 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
577 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
578 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
579 | + <intProp name="LoopController.loops">-1</intProp> | ||
580 | + </elementProp> | ||
581 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
582 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
583 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
584 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
585 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
586 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
587 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
588 | + <stringProp name="TestPlan.comments"></stringProp> | ||
589 | + </ThreadGroup> | ||
590 | + <hashTree> | ||
591 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_resources_config_syncAppDegrade" enabled="true"> | ||
592 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
593 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
594 | + <collectionProp name="Arguments.arguments"> | ||
595 | + <elementProp name="" elementType="HTTPArgument"> | ||
596 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
597 | + <stringProp name="Argument.value"></stringProp> | ||
598 | + <stringProp name="Argument.metadata">=</stringProp> | ||
599 | + </elementProp> | ||
600 | + </collectionProp> | ||
601 | + </elementProp> | ||
602 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
603 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
604 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
605 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
606 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
607 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
608 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
609 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
610 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
611 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
612 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
613 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
614 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
615 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
616 | + <stringProp name="TestPlan.comments"></stringProp> | ||
617 | + </HTTPSamplerProxy> | ||
618 | + <hashTree> | ||
619 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
620 | + <stringProp name="TestPlan.comments"></stringProp> | ||
621 | + <boolProp name="resetInterpreter">false</boolProp> | ||
622 | + <stringProp name="parameters"></stringProp> | ||
623 | + <stringProp name="filename"></stringProp> | ||
624 | + <stringProp name="script">import java.security.MessageDigest; | ||
625 | +import java.util.Random; | ||
626 | +String[] clientTypes = {"android","iphone"}; | ||
627 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
628 | +int rd = new Random().nextInt(2); | ||
629 | +String clientType = clientTypes[rd]; | ||
630 | +String privateKey = privateKeys[rd]; | ||
631 | + | ||
632 | +String req = "app_version=9.9.9&client_type="+clientType+"&config_key=demoteapi&config_value=6,7,8,9,10,12,13,14&method=resources.config.syncAppDegrade&private_key="+privateKey+""; | ||
633 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
634 | +byte[] btInput = req.getBytes(); | ||
635 | +md.update(btInput); | ||
636 | +byte[] btResult = md.digest(); | ||
637 | +StringBuffer sb = new StringBuffer(); | ||
638 | +for(byte b : btResult){ | ||
639 | + int bt = b&0xff; | ||
640 | + if(bt<16){ | ||
641 | + sb.append(0); | ||
642 | + } | ||
643 | + sb.append(Integer.toHexString(bt)); | ||
644 | +} | ||
645 | +String md5 = sb.toString(); | ||
646 | + | ||
647 | + | ||
648 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
649 | + </BeanShellPreProcessor> | ||
650 | + <hashTree/> | ||
651 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
652 | + <collectionProp name="Asserion.test_strings"> | ||
653 | + <stringProp name="1450572480">"code":200</stringProp> | ||
654 | + </collectionProp> | ||
655 | + <stringProp name="TestPlan.comments"></stringProp> | ||
656 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
657 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
658 | + <intProp name="Assertion.test_type">16</intProp> | ||
659 | + </ResponseAssertion> | ||
660 | + <hashTree/> | ||
661 | + </hashTree> | ||
662 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
663 | + <stringProp name="TestPlan.comments"></stringProp> | ||
664 | + <doubleProp> | ||
665 | + <name>throughput</name> | ||
666 | + <value>600</value> | ||
667 | + <savedValue>0.0</savedValue> | ||
668 | + </doubleProp> | ||
669 | + <intProp name="calcMode">2</intProp> | ||
670 | + </ConstantThroughputTimer> | ||
671 | + <hashTree/> | ||
672 | + </hashTree> | ||
673 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_trendword_update" enabled="true"> | ||
674 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
675 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
676 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
677 | + <intProp name="LoopController.loops">-1</intProp> | ||
678 | + </elementProp> | ||
679 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
680 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
681 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
682 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
683 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
684 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
685 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
686 | + <stringProp name="TestPlan.comments">设置潮流口令</stringProp> | ||
687 | + </ThreadGroup> | ||
688 | + <hashTree> | ||
689 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_trendword_update" enabled="true"> | ||
690 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
691 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
692 | + <collectionProp name="Arguments.arguments"> | ||
693 | + <elementProp name="" elementType="HTTPArgument"> | ||
694 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
695 | + <stringProp name="Argument.value"></stringProp> | ||
696 | + <stringProp name="Argument.metadata">=</stringProp> | ||
697 | + </elementProp> | ||
698 | + </collectionProp> | ||
699 | + </elementProp> | ||
700 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
701 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
702 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
703 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
704 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
705 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
706 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
707 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
708 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
709 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
710 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
711 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
712 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
713 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
714 | + <stringProp name="TestPlan.comments">设置潮流口令</stringProp> | ||
715 | + </HTTPSamplerProxy> | ||
716 | + <hashTree> | ||
717 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
718 | + <stringProp name="TestPlan.comments"></stringProp> | ||
719 | + <boolProp name="resetInterpreter">false</boolProp> | ||
720 | + <stringProp name="parameters">${uid_test}</stringProp> | ||
721 | + <stringProp name="filename"></stringProp> | ||
722 | + <stringProp name="script">import java.security.MessageDigest; | ||
723 | +import java.util.Random; | ||
724 | +String[] clientTypes = {"android","iphone"}; | ||
725 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
726 | +int rd = new Random().nextInt(2); | ||
727 | +String clientType = clientTypes[rd]; | ||
728 | +String privateKey = privateKeys[rd]; | ||
729 | + | ||
730 | +String req = "app_version=6.0.0&client_type="+clientType+"&method=app.trendword.update&os_version=10.3.2&physical_channel=2&private_key="+privateKey+"&screen_size=414x736&session_key=f3bd1df3d46d787eae3226a36bb67398&trendWord=yoho_performance_test&udid=0977679e119a72695ba51cd7233e8d8fe208a7b0&uid="+bsh.args[0]+"&v=7"; | ||
731 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
732 | +byte[] btInput = req.getBytes(); | ||
733 | +md.update(btInput); | ||
734 | +byte[] btResult = md.digest(); | ||
735 | +StringBuffer sb = new StringBuffer(); | ||
736 | +for(byte b : btResult){ | ||
737 | + int bt = b&0xff; | ||
738 | + if(bt<16){ | ||
739 | + sb.append(0); | ||
740 | + } | ||
741 | + sb.append(Integer.toHexString(bt)); | ||
742 | +} | ||
743 | +String md5 = sb.toString(); | ||
744 | + | ||
745 | + | ||
746 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
747 | + </BeanShellPreProcessor> | ||
748 | + <hashTree/> | ||
749 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
750 | + <collectionProp name="Asserion.test_strings"> | ||
751 | + <stringProp name="1450572480">"code":200</stringProp> | ||
752 | + </collectionProp> | ||
753 | + <stringProp name="TestPlan.comments"></stringProp> | ||
754 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
755 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
756 | + <intProp name="Assertion.test_type">16</intProp> | ||
757 | + </ResponseAssertion> | ||
758 | + <hashTree/> | ||
759 | + </hashTree> | ||
760 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
761 | + <stringProp name="TestPlan.comments"></stringProp> | ||
762 | + <doubleProp> | ||
763 | + <name>throughput</name> | ||
764 | + <value>600</value> | ||
765 | + <savedValue>0.0</savedValue> | ||
766 | + </doubleProp> | ||
767 | + <intProp name="calcMode">2</intProp> | ||
768 | + </ConstantThroughputTimer> | ||
769 | + <hashTree/> | ||
770 | + </hashTree> | ||
771 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_blk_shopRecommend" enabled="true"> | ||
772 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
773 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
774 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
775 | + <intProp name="LoopController.loops">-1</intProp> | ||
776 | + </elementProp> | ||
777 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
778 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
779 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
780 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
781 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
782 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
783 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
784 | + <stringProp name="TestPlan.comments"></stringProp> | ||
785 | + </ThreadGroup> | ||
786 | + <hashTree> | ||
787 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_blk_shopRecommend" enabled="true"> | ||
788 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
789 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
790 | + <collectionProp name="Arguments.arguments"> | ||
791 | + <elementProp name="" elementType="HTTPArgument"> | ||
792 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
793 | + <stringProp name="Argument.value"></stringProp> | ||
794 | + <stringProp name="Argument.metadata">=</stringProp> | ||
795 | + </elementProp> | ||
796 | + </collectionProp> | ||
797 | + </elementProp> | ||
798 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
799 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
800 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
801 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
802 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
803 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
804 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
805 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
806 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
807 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
808 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
809 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
810 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
811 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
812 | + <stringProp name="TestPlan.comments"></stringProp> | ||
813 | + </HTTPSamplerProxy> | ||
814 | + <hashTree> | ||
815 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
816 | + <stringProp name="TestPlan.comments"></stringProp> | ||
817 | + <boolProp name="resetInterpreter">false</boolProp> | ||
818 | + <stringProp name="parameters">${SNCP} ${product_skn} ${shop_id}</stringProp> | ||
819 | + <stringProp name="filename"></stringProp> | ||
820 | + <stringProp name="script">import java.security.MessageDigest; | ||
821 | +import java.util.Random; | ||
822 | +String[] clientTypes = {"android","iphone"}; | ||
823 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
824 | +int rd = new Random().nextInt(2); | ||
825 | +String clientType = clientTypes[rd]; | ||
826 | +String privateKey = privateKeys[rd]; | ||
827 | +String os_version = "yohobuy:h5"; | ||
828 | +String req = "_sncp="+bsh.args[0]+"&app_type=1&app_version=5.5.2&client_type="+clientType+"&method=app.blk.shopRecommend&os_version="+os_version+"&private_key="+privateKey+"&product_skn="+bsh.args[1]+"&screen_size=720x1280&shopId="+bsh.args[2]+"&v=7&yh_channel=1"; | ||
829 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
830 | +byte[] btInput = req.getBytes(); | ||
831 | +md.update(btInput); | ||
832 | +byte[] btResult = md.digest(); | ||
833 | +StringBuffer sb = new StringBuffer(); | ||
834 | +for(byte b : btResult){ | ||
835 | + int bt = b&0xff; | ||
836 | + if(bt<16){ | ||
837 | + sb.append(0); | ||
838 | + } | ||
839 | + sb.append(Integer.toHexString(bt)); | ||
840 | +} | ||
841 | +String md5 = sb.toString(); | ||
842 | +os_version=URLEncoder.encode(os_version); | ||
843 | +req = "_sncp="+bsh.args[0]+"&app_type=1&app_version=5.5.2&client_type="+clientType+"&method=app.blk.shopRecommend&os_version="+os_version+"&private_key="+privateKey+"&product_skn="+bsh.args[1]+"&screen_size=720x1280&shopId="+bsh.args[2]+"&v=7&yh_channel=1"; | ||
844 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
845 | + </BeanShellPreProcessor> | ||
846 | + <hashTree/> | ||
847 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
848 | + <collectionProp name="Asserion.test_strings"> | ||
849 | + <stringProp name="1450572480">"code":200</stringProp> | ||
850 | + </collectionProp> | ||
851 | + <stringProp name="TestPlan.comments"></stringProp> | ||
852 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
853 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
854 | + <intProp name="Assertion.test_type">16</intProp> | ||
855 | + </ResponseAssertion> | ||
856 | + <hashTree/> | ||
857 | + </hashTree> | ||
858 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
859 | + <stringProp name="TestPlan.comments"></stringProp> | ||
860 | + <doubleProp> | ||
861 | + <name>throughput</name> | ||
862 | + <value>600</value> | ||
863 | + <savedValue>0.0</savedValue> | ||
864 | + </doubleProp> | ||
865 | + <intProp name="calcMode">2</intProp> | ||
866 | + </ConstantThroughputTimer> | ||
867 | + <hashTree/> | ||
868 | + </hashTree> | ||
869 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_limitTimeAdvance_data" enabled="true"> | ||
870 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
871 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
872 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
873 | + <intProp name="LoopController.loops">-1</intProp> | ||
874 | + </elementProp> | ||
875 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
876 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
877 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
878 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
879 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
880 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
881 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
882 | + <stringProp name="TestPlan.comments">定时促销信息</stringProp> | ||
883 | + </ThreadGroup> | ||
884 | + <hashTree> | ||
885 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_limitTimeAdvance_data" enabled="true"> | ||
886 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
887 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
888 | + <collectionProp name="Arguments.arguments"> | ||
889 | + <elementProp name="" elementType="HTTPArgument"> | ||
890 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
891 | + <stringProp name="Argument.value"></stringProp> | ||
892 | + <stringProp name="Argument.metadata">=</stringProp> | ||
893 | + </elementProp> | ||
894 | + </collectionProp> | ||
895 | + </elementProp> | ||
896 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
897 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
898 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
899 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
900 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
901 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
902 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
903 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
904 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
905 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
906 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
907 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
908 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
909 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
910 | + <stringProp name="TestPlan.comments">定时促销信息</stringProp> | ||
911 | + </HTTPSamplerProxy> | ||
912 | + <hashTree> | ||
913 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
914 | + <stringProp name="TestPlan.comments"></stringProp> | ||
915 | + <boolProp name="resetInterpreter">false</boolProp> | ||
916 | + <stringProp name="parameters">${product_skn} ${uid_test}</stringProp> | ||
917 | + <stringProp name="filename"></stringProp> | ||
918 | + <stringProp name="script">import java.security.MessageDigest; | ||
919 | +import java.util.Random; | ||
920 | +String[] clientTypes = {"android","iphone"}; | ||
921 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
922 | +int rd = new Random().nextInt(2); | ||
923 | +String clientType = clientTypes[rd]; | ||
924 | +String privateKey = privateKeys[rd]; | ||
925 | + | ||
926 | +String req = "app_version=6.0.1&client_type="+clientType+"&fromPage=iFP_ProductDetail&method=app.limitTimeAdvance.data&os_version=10.3.3&physical_channel=2&private_key="+privateKey+"&product_skn="+bsh.args[0]+"&screen_size=414x736&session_key=71943bf414eacde53fe4c7c145fa3b2e&udid=7318b0a9641e1d09a14a9cf65f9343e71f973efa&uid="+bsh.args[1]+"&v=7"; | ||
927 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
928 | +byte[] btInput = req.getBytes(); | ||
929 | +md.update(btInput); | ||
930 | +byte[] btResult = md.digest(); | ||
931 | +StringBuffer sb = new StringBuffer(); | ||
932 | +for(byte b : btResult){ | ||
933 | + int bt = b&0xff; | ||
934 | + if(bt<16){ | ||
935 | + sb.append(0); | ||
936 | + } | ||
937 | + sb.append(Integer.toHexString(bt)); | ||
938 | +} | ||
939 | +String md5 = sb.toString(); | ||
940 | + | ||
941 | + | ||
942 | +vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | ||
943 | + </BeanShellPreProcessor> | ||
944 | + <hashTree/> | ||
945 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> | ||
946 | + <collectionProp name="Asserion.test_strings"> | ||
947 | + <stringProp name="1450572480">"code":200</stringProp> | ||
948 | + </collectionProp> | ||
949 | + <stringProp name="TestPlan.comments"></stringProp> | ||
950 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> | ||
951 | + <boolProp name="Assertion.assume_success">false</boolProp> | ||
952 | + <intProp name="Assertion.test_type">16</intProp> | ||
953 | + </ResponseAssertion> | ||
954 | + <hashTree/> | ||
955 | + </hashTree> | ||
956 | + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | ||
957 | + <stringProp name="TestPlan.comments"></stringProp> | ||
958 | + <doubleProp> | ||
959 | + <name>throughput</name> | ||
960 | + <value>600</value> | ||
961 | + <savedValue>0.0</savedValue> | ||
962 | + </doubleProp> | ||
963 | + <intProp name="calcMode">2</intProp> | ||
964 | + </ConstantThroughputTimer> | ||
965 | + <hashTree/> | ||
966 | + </hashTree> | ||
967 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_shopActivity_activityList" enabled="true"> | ||
968 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | ||
969 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> | ||
970 | + <boolProp name="LoopController.continue_forever">false</boolProp> | ||
971 | + <intProp name="LoopController.loops">-1</intProp> | ||
972 | + </elementProp> | ||
973 | + <stringProp name="ThreadGroup.num_threads">1</stringProp> | ||
974 | + <stringProp name="ThreadGroup.ramp_time">10</stringProp> | ||
975 | + <longProp name="ThreadGroup.start_time">1488865571000</longProp> | ||
976 | + <longProp name="ThreadGroup.end_time">1488865571000</longProp> | ||
977 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> | ||
978 | + <stringProp name="ThreadGroup.duration"></stringProp> | ||
979 | + <stringProp name="ThreadGroup.delay"></stringProp> | ||
980 | + <stringProp name="TestPlan.comments"></stringProp> | ||
981 | + </ThreadGroup> | ||
982 | + <hashTree> | ||
983 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_shopActivity_activityList" enabled="true"> | ||
984 | + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> | ||
985 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> | ||
986 | + <collectionProp name="Arguments.arguments"> | ||
987 | + <elementProp name="" elementType="HTTPArgument"> | ||
988 | + <boolProp name="HTTPArgument.always_encode">false</boolProp> | ||
989 | + <stringProp name="Argument.value"></stringProp> | ||
990 | + <stringProp name="Argument.metadata">=</stringProp> | ||
991 | + </elementProp> | ||
992 | + </collectionProp> | ||
993 | + </elementProp> | ||
994 | + <stringProp name="HTTPSampler.domain"></stringProp> | ||
995 | + <stringProp name="HTTPSampler.port"></stringProp> | ||
996 | + <stringProp name="HTTPSampler.connect_timeout"></stringProp> | ||
997 | + <stringProp name="HTTPSampler.response_timeout"></stringProp> | ||
998 | + <stringProp name="HTTPSampler.protocol"></stringProp> | ||
999 | + <stringProp name="HTTPSampler.contentEncoding"></stringProp> | ||
1000 | + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp> | ||
1001 | + <stringProp name="HTTPSampler.method">GET</stringProp> | ||
1002 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | ||
1003 | + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | ||
1004 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | ||
1005 | + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | ||
1006 | + <boolProp name="HTTPSampler.monitor">false</boolProp> | ||
1007 | + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | ||
1008 | + <stringProp name="TestPlan.comments"></stringProp> | ||
1009 | + </HTTPSamplerProxy> | ||
1010 | + <hashTree> | ||
1011 | + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true"> | ||
1012 | + <stringProp name="TestPlan.comments"></stringProp> | ||
1013 | + <boolProp name="resetInterpreter">false</boolProp> | ||
1014 | + <stringProp name="parameters">${uid_test}</stringProp> | ||
1015 | + <stringProp name="filename"></stringProp> | ||
1016 | + <stringProp name="script">import java.security.MessageDigest; | ||
1017 | +import java.util.Random; | ||
1018 | +String[] clientTypes = {"android","iphone"}; | ||
1019 | +String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585","a85bb0674e08986c6b115d5e3a4884fa"}; | ||
1020 | +int rd = new Random().nextInt(2); | ||
1021 | +String clientType = clientTypes[rd]; | ||
1022 | +String privateKey = privateKeys[rd]; | ||
1023 | + | ||
1024 | +String req = "app_version=6.0.0&client_type="+clientType+"&limit=20&method=app.shopActivity.activityList&os_version=10.3.3&page=1&physical_channel=1&private_key="+privateKey+"&screen_size=375x667&session_key=3d643a53e0d0181eee90b7824c85169b&udid=9cf3c7118e716c021db517bcab6c1716b34dd859&uid="+bsh.args[0]+"&v=7"; | ||
1025 | +MessageDigest md = MessageDigest.getInstance("MD5"); | ||
1026 | +byte[] btInput = req.getBytes(); | ||
1027 | +md.update(btInput); | ||
1028 | +byte[] btResult = md.digest(); | ||
1029 | +StringBuffer sb = new StringBuffer(); | ||
1030 | +for(byte b : btResult){ | ||
1031 | + int bt = b&0xff; | ||
1032 | + if(bt<16){ | ||
1033 | + sb.append(0); | ||
1034 | + } | ||
1035 | + sb.append(Integer.toHexString(bt)); | ||
1036 | +} | ||
1037 | +String md5 = sb.toString(); | ||
1038 | + | ||
1039 | + | ||
190 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> | 1040 | vars.put("searchValue",req+"&client_secret="+md5);</stringProp> |
191 | </BeanShellPreProcessor> | 1041 | </BeanShellPreProcessor> |
192 | <hashTree/> | 1042 | <hashTree/> |
@@ -201,12 +1051,11 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | @@ -201,12 +1051,11 @@ vars.put("searchValue",req+"&client_secret="+md5);</stri | ||
201 | </ResponseAssertion> | 1051 | </ResponseAssertion> |
202 | <hashTree/> | 1052 | <hashTree/> |
203 | </hashTree> | 1053 | </hashTree> |
204 | -</hashTree> | ||
205 | <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> | 1054 | <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true"> |
206 | <stringProp name="TestPlan.comments"></stringProp> | 1055 | <stringProp name="TestPlan.comments"></stringProp> |
207 | <doubleProp> | 1056 | <doubleProp> |
208 | <name>throughput</name> | 1057 | <name>throughput</name> |
209 | - <value>1200</value> | 1058 | + <value>600</value> |
210 | <savedValue>0.0</savedValue> | 1059 | <savedValue>0.0</savedValue> |
211 | </doubleProp> | 1060 | </doubleProp> |
212 | <intProp name="calcMode">2</intProp> | 1061 | <intProp name="calcMode">2</intProp> |
-
Please register or login to post a comment