|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3"> |
| 3 | + <hashTree> |
| 4 | + <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="API Load Test - JSONPlaceholder" enabled="true"> |
| 5 | + <stringProp name="TestPlan.comments">Parameterized load test. Override at runtime, e.g. -Jusers=50 -Jrampup=10 -Jloops=10</stringProp> |
| 6 | + <boolProp name="TestPlan.functional_mode">false</boolProp> |
| 7 | + <boolProp name="TestPlan.serialize_threadgroups">false</boolProp> |
| 8 | + <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> |
| 9 | + <collectionProp name="Arguments.arguments"> |
| 10 | + <elementProp name="HOST" elementType="Argument"> |
| 11 | + <stringProp name="Argument.name">HOST</stringProp> |
| 12 | + <stringProp name="Argument.value">${__P(host,jsonplaceholder.typicode.com)}</stringProp> |
| 13 | + <stringProp name="Argument.metadata">=</stringProp> |
| 14 | + </elementProp> |
| 15 | + <elementProp name="PROTOCOL" elementType="Argument"> |
| 16 | + <stringProp name="Argument.name">PROTOCOL</stringProp> |
| 17 | + <stringProp name="Argument.value">${__P(protocol,https)}</stringProp> |
| 18 | + <stringProp name="Argument.metadata">=</stringProp> |
| 19 | + </elementProp> |
| 20 | + </collectionProp> |
| 21 | + </elementProp> |
| 22 | + </TestPlan> |
| 23 | + <hashTree> |
| 24 | + <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true"> |
| 25 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> |
| 26 | + <collectionProp name="Arguments.arguments"/> |
| 27 | + </elementProp> |
| 28 | + <stringProp name="HTTPSampler.domain">${HOST}</stringProp> |
| 29 | + <stringProp name="HTTPSampler.protocol">${PROTOCOL}</stringProp> |
| 30 | + <stringProp name="HTTPSampler.connect_timeout">5000</stringProp> |
| 31 | + <stringProp name="HTTPSampler.response_timeout">10000</stringProp> |
| 32 | + </ConfigTestElement> |
| 33 | + <hashTree/> |
| 34 | + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> |
| 35 | + <collectionProp name="HeaderManager.headers"> |
| 36 | + <elementProp name="" elementType="Header"> |
| 37 | + <stringProp name="Header.name">Accept</stringProp> |
| 38 | + <stringProp name="Header.value">application/json</stringProp> |
| 39 | + </elementProp> |
| 40 | + </collectionProp> |
| 41 | + </HeaderManager> |
| 42 | + <hashTree/> |
| 43 | + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="API Users" enabled="true"> |
| 44 | + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> |
| 45 | + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> |
| 46 | + <boolProp name="LoopController.continue_forever">false</boolProp> |
| 47 | + <stringProp name="LoopController.loops">${__P(loops,5)}</stringProp> |
| 48 | + </elementProp> |
| 49 | + <stringProp name="ThreadGroup.num_threads">${__P(users,10)}</stringProp> |
| 50 | + <stringProp name="ThreadGroup.ramp_time">${__P(rampup,5)}</stringProp> |
| 51 | + <boolProp name="ThreadGroup.scheduler">false</boolProp> |
| 52 | + <stringProp name="ThreadGroup.duration"></stringProp> |
| 53 | + <stringProp name="ThreadGroup.delay"></stringProp> |
| 54 | + </ThreadGroup> |
| 55 | + <hashTree> |
| 56 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GET /posts" enabled="true"> |
| 57 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> |
| 58 | + <collectionProp name="Arguments.arguments"/> |
| 59 | + </elementProp> |
| 60 | + <stringProp name="HTTPSampler.path">/posts</stringProp> |
| 61 | + <stringProp name="HTTPSampler.method">GET</stringProp> |
| 62 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> |
| 63 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> |
| 64 | + </HTTPSamplerProxy> |
| 65 | + <hashTree> |
| 66 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Status 200" enabled="true"> |
| 67 | + <collectionProp name="Asserion.test_strings"> |
| 68 | + <stringProp name="49586">200</stringProp> |
| 69 | + </collectionProp> |
| 70 | + <stringProp name="Assertion.custom_message">Expected HTTP 200 on /posts</stringProp> |
| 71 | + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> |
| 72 | + <boolProp name="Assertion.assume_success">false</boolProp> |
| 73 | + <intProp name="Assertion.test_type">8</intProp> |
| 74 | + </ResponseAssertion> |
| 75 | + <hashTree/> |
| 76 | + <DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="Under 2s" enabled="true"> |
| 77 | + <stringProp name="DurationAssertion.duration">2000</stringProp> |
| 78 | + </DurationAssertion> |
| 79 | + <hashTree/> |
| 80 | + </hashTree> |
| 81 | + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GET /posts/1" enabled="true"> |
| 82 | + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> |
| 83 | + <collectionProp name="Arguments.arguments"/> |
| 84 | + </elementProp> |
| 85 | + <stringProp name="HTTPSampler.path">/posts/1</stringProp> |
| 86 | + <stringProp name="HTTPSampler.method">GET</stringProp> |
| 87 | + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> |
| 88 | + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> |
| 89 | + </HTTPSamplerProxy> |
| 90 | + <hashTree> |
| 91 | + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Body contains userId" enabled="true"> |
| 92 | + <collectionProp name="Asserion.test_strings"> |
| 93 | + <stringProp name="-836313440">userId</stringProp> |
| 94 | + </collectionProp> |
| 95 | + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> |
| 96 | + <boolProp name="Assertion.assume_success">false</boolProp> |
| 97 | + <intProp name="Assertion.test_type">16</intProp> |
| 98 | + </ResponseAssertion> |
| 99 | + <hashTree/> |
| 100 | + </hashTree> |
| 101 | + </hashTree> |
| 102 | + </hashTree> |
| 103 | + </hashTree> |
| 104 | +</jmeterTestPlan> |
0 commit comments