Skip to content

Commit 9d7c362

Browse files
committed
Use code sample ref for jmeter-based test
1 parent e63cb69 commit 9d7c362

File tree

1 file changed

+3
-53
lines changed

1 file changed

+3
-53
lines changed

articles/load-testing/how-to-create-and-run-load-test-with-jmeter-script.md

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Use cases for creating a load test with an existing JMeter script include:
3030

3131
- An Azure Load Testing resource. If you need to create an Azure Load Testing resource, see the quickstart [Create and run a load test](./quickstart-create-and-run-load-test.md).
3232

33+
- [Clone or download the samples project from GitHub](https://github.com/Azure-Samples/azure-load-testing-samples/tree/main/jmeter-basic-endpoint)
34+
3335
## Create an Apache JMeter script
3436

3537
If you already have a script, you can skip to [Create a load test](#create-a-load-test). In this section, you'll create a sample JMeter test script to load test a single web endpoint.
@@ -48,59 +50,7 @@ To create a sample JMeter test script:
4850
4951
This script simulates a load test of five virtual users that simultaneously access a web endpoint, and takes 2 minutes to complete.
5052
51-
```xml
52-
<?xml version="1.0" encoding="UTF-8"?>
53-
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1">
54-
<hashTree>
55-
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Azure Load Testing Quickstart" enabled="true">
56-
<stringProp name="TestPlan.comments"></stringProp>
57-
<boolProp name="TestPlan.functional_mode">false</boolProp>
58-
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
59-
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
60-
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
61-
<collectionProp name="Arguments.arguments"/>
62-
</elementProp>
63-
<stringProp name="TestPlan.user_define_classpath"></stringProp>
64-
</TestPlan>
65-
<hashTree>
66-
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Web endpoint test" enabled="true">
67-
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
68-
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
69-
<boolProp name="LoopController.continue_forever">false</boolProp>
70-
<intProp name="LoopController.loops">-1</intProp>
71-
</elementProp>
72-
<stringProp name="ThreadGroup.num_threads">5</stringProp>
73-
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
74-
<boolProp name="ThreadGroup.scheduler">true</boolProp>
75-
<stringProp name="ThreadGroup.duration">120</stringProp>
76-
<stringProp name="ThreadGroup.delay">5</stringProp>
77-
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
78-
</ThreadGroup>
79-
<hashTree>
80-
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP request" enabled="true">
81-
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="Sample web test" enabled="true">
82-
<collectionProp name="Arguments.arguments"/>
83-
</elementProp>
84-
<stringProp name="HTTPSampler.domain"></stringProp>
85-
<stringProp name="HTTPSampler.port"></stringProp>
86-
<stringProp name="HTTPSampler.protocol"></stringProp>
87-
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
88-
<stringProp name="HTTPSampler.path"></stringProp>
89-
<stringProp name="HTTPSampler.method">GET</stringProp>
90-
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
91-
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
92-
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
93-
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
94-
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
95-
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
96-
<stringProp name="HTTPSampler.response_timeout"></stringProp>
97-
</HTTPSamplerProxy>
98-
<hashTree/>
99-
</hashTree>
100-
</hashTree>
101-
</hashTree>
102-
</jmeterTestPlan>
103-
```
53+
:::code language="xml" source="~/azure-load-testing-samples/jmeter-basic-endpoint/sample.jmx" highlight="33,37":::
10454
10555
1. In the file, set the value of the `HTTPSampler.domain` node to the host name of your endpoint. For example, if you want to test the endpoint `https://www.contoso.com/app/products`, the host name is `www.contoso.com`.
10656

0 commit comments

Comments
 (0)