Skip to content

Commit 94feddd

Browse files
committed
Improve example jmx by using HeaderManager and Assertion
1 parent bb3fa92 commit 94feddd

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

example/simple_request.jmx

+65-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<stringProp name="TestPlan.user_define_classpath"></stringProp>
1212
</TestPlan>
1313
<hashTree>
14-
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="setUp Thread Group" enabled="true">
14+
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="Thread Group" enabled="true">
1515
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
1616
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
1717
<boolProp name="LoopController.continue_forever">false</boolProp>
@@ -26,13 +26,43 @@
2626
<stringProp name="ThreadGroup.delay"></stringProp>
2727
</SetupThreadGroup>
2828
<hashTree>
29+
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP header Manager" enabled="true">
30+
<collectionProp name="HeaderManager.headers">
31+
<elementProp name="" elementType="Header">
32+
<stringProp name="Header.name">accept</stringProp>
33+
<stringProp name="Header.value">*/*</stringProp>
34+
</elementProp>
35+
<elementProp name="" elementType="Header">
36+
<stringProp name="Header.name">accept-encoding</stringProp>
37+
<stringProp name="Header.value">gzip</stringProp>
38+
</elementProp>
39+
<elementProp name="" elementType="Header">
40+
<stringProp name="Header.name">accept-encoding</stringProp>
41+
<stringProp name="Header.value">deflate</stringProp>
42+
</elementProp>
43+
<elementProp name="" elementType="Header">
44+
<stringProp name="Header.name">user-agent</stringProp>
45+
<stringProp name="Header.value">ApacheJMeterHTTP2Sampler</stringProp>
46+
</elementProp>
47+
</collectionProp>
48+
</HeaderManager>
49+
<hashTree/>
2950
<jmeter.plugins.http2.sampler.HTTP2Sampler guiclass="jmeter.plugins.http2.sampler.gui.HTTP2SamplerGui" testclass="jmeter.plugins.http2.sampler.HTTP2Sampler" testname="HTTP2 Sampler" enabled="true">
3051
<stringProp name="HTTP2Sampler.method">GET</stringProp>
3152
<stringProp name="HTTP2Sampler.domain">127.0.0.1</stringProp>
3253
<stringProp name="HTTP2Sampler.port">4430</stringProp>
3354
<stringProp name="TTP2Sampler.host">/</stringProp>
3455
</jmeter.plugins.http2.sampler.HTTP2Sampler>
3556
<hashTree>
57+
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Is the response code OK?" enabled="true">
58+
<collectionProp name="Asserion.test_strings">
59+
<stringProp name="49586">200</stringProp>
60+
</collectionProp>
61+
<stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
62+
<boolProp name="Assertion.assume_success">false</boolProp>
63+
<intProp name="Assertion.test_type">1</intProp>
64+
</ResponseAssertion>
65+
<hashTree/>
3666
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="Resalt as table" enabled="true">
3767
<boolProp name="ResultCollector.error_logging">false</boolProp>
3868
<objProp>
@@ -67,6 +97,40 @@
6797
<stringProp name="filename">result.jtl</stringProp>
6898
</ResultCollector>
6999
<hashTree/>
100+
<ResultCollector guiclass="AssertionVisualizer" testclass="ResultCollector" testname="Assertion results" enabled="true">
101+
<boolProp name="ResultCollector.error_logging">false</boolProp>
102+
<objProp>
103+
<name>saveConfig</name>
104+
<value class="SampleSaveConfiguration">
105+
<time>true</time>
106+
<latency>true</latency>
107+
<timestamp>true</timestamp>
108+
<success>true</success>
109+
<label>true</label>
110+
<code>true</code>
111+
<message>true</message>
112+
<threadName>true</threadName>
113+
<dataType>true</dataType>
114+
<encoding>false</encoding>
115+
<assertions>true</assertions>
116+
<subresults>true</subresults>
117+
<responseData>false</responseData>
118+
<samplerData>false</samplerData>
119+
<xml>false</xml>
120+
<fieldNames>false</fieldNames>
121+
<responseHeaders>false</responseHeaders>
122+
<requestHeaders>false</requestHeaders>
123+
<responseDataOnError>false</responseDataOnError>
124+
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
125+
<assertionsResultsToSave>0</assertionsResultsToSave>
126+
<bytes>true</bytes>
127+
<threadCounts>true</threadCounts>
128+
</value>
129+
</objProp>
130+
<stringProp name="filename"></stringProp>
131+
<boolProp name="ResultCollector.success_only_logging">true</boolProp>
132+
</ResultCollector>
133+
<hashTree/>
70134
</hashTree>
71135
</hashTree>
72136
</hashTree>

0 commit comments

Comments
 (0)