github.com/kubeshop/testkube@v1.17.23/test/jmeter/executor-tests/jmeter-executor-smoke-env-and-property.jmx (about) 1 <?xml version="1.0" encoding="UTF-8"?> 2 <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.5"> 3 <hashTree> 4 <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> 5 <stringProp name="TestPlan.comments"></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> 11 <stringProp name="TestPlan.user_define_classpath"></stringProp> 12 </TestPlan> 13 <hashTree> 14 <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> 15 <collectionProp name="Arguments.arguments"> 16 <elementProp name="url_property" elementType="Argument"> 17 <stringProp name="Argument.name">url_property</stringProp> 18 <stringProp name="Argument.value">${__P(URL_PROPERTY)}</stringProp> 19 <stringProp name="Argument.metadata">=</stringProp> 20 </elementProp> 21 <elementProp name="url_env" elementType="Argument"> 22 <stringProp name="Argument.name">url_env</stringProp> 23 <stringProp name="Argument.value">${__BeanShell( System.getenv("URL_ENV") )}</stringProp> 24 <stringProp name="Argument.metadata">=</stringProp> 25 </elementProp> 26 </collectionProp> 27 </Arguments> 28 <hashTree/> 29 <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group - property test" enabled="true"> 30 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> 31 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> 32 <boolProp name="LoopController.continue_forever">false</boolProp> 33 <stringProp name="LoopController.loops">1</stringProp> 34 </elementProp> 35 <stringProp name="ThreadGroup.num_threads">1</stringProp> 36 <stringProp name="ThreadGroup.ramp_time">1</stringProp> 37 <longProp name="ThreadGroup.start_time">1668426657000</longProp> 38 <longProp name="ThreadGroup.end_time">1668426657000</longProp> 39 <boolProp name="ThreadGroup.scheduler">false</boolProp> 40 <stringProp name="ThreadGroup.duration"></stringProp> 41 <stringProp name="ThreadGroup.delay"></stringProp> 42 <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp> 43 </ThreadGroup> 44 <hashTree> 45 <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Testkube - HTTP Request" enabled="true"> 46 <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> 47 <collectionProp name="Arguments.arguments"/> 48 </elementProp> 49 <stringProp name="HTTPSampler.domain">testkube.io</stringProp> 50 <stringProp name="HTTPSampler.port"></stringProp> 51 <stringProp name="HTTPSampler.protocol"></stringProp> 52 <stringProp name="HTTPSampler.contentEncoding"></stringProp> 53 <stringProp name="HTTPSampler.path"></stringProp> 54 <stringProp name="HTTPSampler.method">GET</stringProp> 55 <boolProp name="HTTPSampler.follow_redirects">true</boolProp> 56 <boolProp name="HTTPSampler.auto_redirects">false</boolProp> 57 <boolProp name="HTTPSampler.use_keepalive">true</boolProp> 58 <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> 59 <stringProp name="HTTPSampler.embedded_url_re"></stringProp> 60 <stringProp name="HTTPSampler.connect_timeout"></stringProp> 61 <stringProp name="HTTPSampler.response_timeout"></stringProp> 62 </HTTPSamplerProxy> 63 <hashTree/> 64 <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="JSR223 PostProcessor" enabled="true"> 65 <stringProp name="scriptLanguage">groovy</stringProp> 66 <stringProp name="parameters"></stringProp> 67 <stringProp name="filename"></stringProp> 68 <stringProp name="cacheKey">true</stringProp> 69 <stringProp name="script">println("Property and ENV Test") 70 if(vars.get("url_property") != "testkube.io") { 71 println("Incorrect property - url_property should equal \"testkube.io\"") 72 System.exit(1); 73 } else if(vars.get("url_env") != "testkube.io") { 74 println("Incorrect ENV - url_property should equal \"testkube.io\"") 75 System.exit(1); 76 } else { 77 println("OK") 78 } 79 </stringProp> 80 </JSR223PostProcessor> 81 <hashTree/> 82 </hashTree> 83 </hashTree> 84 </hashTree> 85 </jmeterTestPlan>