@@ -47,57 +47,57 @@ In this section, you'll create a sample Apache JMeter script that you'll use in
47
47
1. Open *SampleTest.jmx* in a text editor and paste the following code snippet in the file:
48
48
49
49
```xml
50
- <?xml version="1.0" encoding="UTF-8"?>
51
- <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1">
52
- <hashTree>
53
- <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Azure Load Testing Quickstart" enabled="true">
54
- <stringProp name="TestPlan.comments"></stringProp>
55
- <boolProp name="TestPlan.functional_mode">false</boolProp>
56
- <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
57
- <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
58
- <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
59
- <collectionProp name="Arguments.arguments"/>
60
- </elementProp>
61
- <stringProp name="TestPlan.user_define_classpath"></stringProp>
62
- </TestPlan>
63
- <hashTree>
64
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
65
- <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
66
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
67
- <boolProp name="LoopController.continue_forever">false</boolProp>
68
- <intProp name="LoopController.loops">-1</intProp>
69
- </elementProp>
70
- <stringProp name="ThreadGroup.num_threads">5</stringProp>
71
- <stringProp name="ThreadGroup.ramp_time">10</stringProp>
72
- <boolProp name="ThreadGroup.scheduler">true</boolProp>
73
- <stringProp name="ThreadGroup.duration">120</stringProp>
74
- <stringProp name="ThreadGroup.delay">5</stringProp>
75
- <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
76
- </ThreadGroup>
50
+ <?xml version="1.0" encoding="UTF-8"?>
51
+ <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1">
77
52
<hashTree>
78
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Homepage" enabled="true">
79
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
53
+ <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Azure Load Testing Quickstart" enabled="true">
54
+ <stringProp name="TestPlan.comments"></stringProp>
55
+ <boolProp name="TestPlan.functional_mode">false</boolProp>
56
+ <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
57
+ <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
58
+ <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
80
59
<collectionProp name="Arguments.arguments"/>
81
60
</elementProp>
82
- <stringProp name="HTTPSampler.domain">your-endpoint-url</stringProp>
83
- <stringProp name="HTTPSampler.port"></stringProp>
84
- <stringProp name="HTTPSampler.protocol"></stringProp>
85
- <stringProp name="HTTPSampler.contentEncoding"></stringProp>
86
- <stringProp name="HTTPSampler.path"></stringProp>
87
- <stringProp name="HTTPSampler.method">GET</stringProp>
88
- <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
89
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
90
- <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
91
- <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
92
- <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
93
- <stringProp name="HTTPSampler.connect_timeout"></stringProp>
94
- <stringProp name="HTTPSampler.response_timeout"></stringProp>
95
- </HTTPSamplerProxy>
96
- <hashTree/>
61
+ <stringProp name="TestPlan.user_define_classpath"></stringProp>
62
+ </TestPlan>
63
+ <hashTree>
64
+ <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
65
+ <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
66
+ <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
67
+ <boolProp name="LoopController.continue_forever">false</boolProp>
68
+ <intProp name="LoopController.loops">-1</intProp>
69
+ </elementProp>
70
+ <stringProp name="ThreadGroup.num_threads">5</stringProp>
71
+ <stringProp name="ThreadGroup.ramp_time">10</stringProp>
72
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
73
+ <stringProp name="ThreadGroup.duration">120</stringProp>
74
+ <stringProp name="ThreadGroup.delay">5</stringProp>
75
+ <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
76
+ </ThreadGroup>
77
+ <hashTree>
78
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Homepage" enabled="true">
79
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
80
+ <collectionProp name="Arguments.arguments"/>
81
+ </elementProp>
82
+ <stringProp name="HTTPSampler.domain">your-endpoint-url</stringProp>
83
+ <stringProp name="HTTPSampler.port"></stringProp>
84
+ <stringProp name="HTTPSampler.protocol"></stringProp>
85
+ <stringProp name="HTTPSampler.contentEncoding"></stringProp>
86
+ <stringProp name="HTTPSampler.path"></stringProp>
87
+ <stringProp name="HTTPSampler.method">GET</stringProp>
88
+ <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
89
+ <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
90
+ <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
91
+ <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
92
+ <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
93
+ <stringProp name="HTTPSampler.connect_timeout"></stringProp>
94
+ <stringProp name="HTTPSampler.response_timeout"></stringProp>
95
+ </HTTPSamplerProxy>
96
+ <hashTree/>
97
+ </hashTree>
98
+ </hashTree>
97
99
</hashTree>
98
- </hashTree>
99
- </hashTree>
100
- </jmeterTestPlan>
100
+ </jmeterTestPlan>
101
101
```
102
102
103
103
This sample Apache JMeter script simulates a load test of five virtual users simultaneously accessing a web endpoint. It takes less than two minutes to complete.
0 commit comments