Created
January 7, 2016 12:44
-
-
Save alphamikevictor/bd20c329e25d0e8494fb to your computer and use it in GitHub Desktop.
Possible solution for StackOverflow http://stackoverflow.com/questions/34654140/verify-whole-json-response-in-jmeter-by-value-or-sort-json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067"> | |
| <hashTree> | |
| <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> | |
| <stringProp name="TestPlan.comments"></stringProp> | |
| <boolProp name="TestPlan.functional_mode">false</boolProp> | |
| <boolProp name="TestPlan.serialize_threadgroups">false</boolProp> | |
| <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> | |
| <collectionProp name="Arguments.arguments"/> | |
| </elementProp> | |
| <stringProp name="TestPlan.user_define_classpath"></stringProp> | |
| </TestPlan> | |
| <hashTree> | |
| <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Test" enabled="true"> | |
| <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> | |
| <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> | |
| <boolProp name="LoopController.continue_forever">false</boolProp> | |
| <stringProp name="LoopController.loops">1</stringProp> | |
| </elementProp> | |
| <stringProp name="ThreadGroup.num_threads">1</stringProp> | |
| <stringProp name="ThreadGroup.ramp_time">1</stringProp> | |
| <longProp name="ThreadGroup.start_time">1452169224000</longProp> | |
| <longProp name="ThreadGroup.end_time">1452169224000</longProp> | |
| <boolProp name="ThreadGroup.scheduler">false</boolProp> | |
| <stringProp name="ThreadGroup.duration"></stringProp> | |
| <stringProp name="ThreadGroup.delay"></stringProp> | |
| </ThreadGroup> | |
| <hashTree> | |
| <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Sampler 1" enabled="true"> | |
| <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> | |
| <collectionProp name="Arguments.arguments"/> | |
| </elementProp> | |
| <stringProp name="HTTPSampler.domain">dvaesrpx01</stringProp> | |
| <stringProp name="HTTPSampler.port">80</stringProp> | |
| <stringProp name="HTTPSampler.connect_timeout"></stringProp> | |
| <stringProp name="HTTPSampler.response_timeout"></stringProp> | |
| <stringProp name="HTTPSampler.protocol"></stringProp> | |
| <stringProp name="HTTPSampler.contentEncoding"></stringProp> | |
| <stringProp name="HTTPSampler.path">/example1.js</stringProp> | |
| <stringProp name="HTTPSampler.method">GET</stringProp> | |
| <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | |
| <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | |
| <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | |
| <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | |
| <boolProp name="HTTPSampler.monitor">false</boolProp> | |
| <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | |
| </HTTPSamplerProxy> | |
| <hashTree> | |
| <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="BeanShell PostProcessor" enabled="true"> | |
| <boolProp name="resetInterpreter">false</boolProp> | |
| <stringProp name="parameters"></stringProp> | |
| <stringProp name="filename"></stringProp> | |
| <stringProp name="script">vars.put("jsonSampler1",prev.getResponseDataAsString());</stringProp> | |
| </BeanShellPostProcessor> | |
| <hashTree/> | |
| </hashTree> | |
| <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Sampler 2" enabled="true"> | |
| <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> | |
| <collectionProp name="Arguments.arguments"/> | |
| </elementProp> | |
| <stringProp name="HTTPSampler.domain">dvaesrpx01</stringProp> | |
| <stringProp name="HTTPSampler.port">80</stringProp> | |
| <stringProp name="HTTPSampler.connect_timeout"></stringProp> | |
| <stringProp name="HTTPSampler.response_timeout"></stringProp> | |
| <stringProp name="HTTPSampler.protocol"></stringProp> | |
| <stringProp name="HTTPSampler.contentEncoding"></stringProp> | |
| <stringProp name="HTTPSampler.path">/example2.js</stringProp> | |
| <stringProp name="HTTPSampler.method">GET</stringProp> | |
| <boolProp name="HTTPSampler.follow_redirects">true</boolProp> | |
| <boolProp name="HTTPSampler.auto_redirects">false</boolProp> | |
| <boolProp name="HTTPSampler.use_keepalive">true</boolProp> | |
| <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> | |
| <boolProp name="HTTPSampler.monitor">false</boolProp> | |
| <stringProp name="HTTPSampler.embedded_url_re"></stringProp> | |
| </HTTPSamplerProxy> | |
| <hashTree> | |
| <BSFAssertion guiclass="TestBeanGUI" testclass="BSFAssertion" testname="BSF Assertion" enabled="true"> | |
| <stringProp name="filename"></stringProp> | |
| <stringProp name="parameters"></stringProp> | |
| <stringProp name="script">import json | |
| jsonSampler1 = vars.get("jsonSampler1") | |
| jsonSampler2 = prev.getResponseDataAsString() | |
| objectSampler1 = json.loads(jsonSampler1) | |
| objectSampler2 = json.loads(jsonSampler2) | |
| if ( objectSampler1 != objectSampler2 ): | |
| AssertionResult.setFailure(True) | |
| AssertionResult.setFailureMessage("JSON data didn't match")</stringProp> | |
| <stringProp name="scriptLanguage">jython</stringProp> | |
| </BSFAssertion> | |
| <hashTree/> | |
| </hashTree> | |
| <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> | |
| <boolProp name="ResultCollector.error_logging">false</boolProp> | |
| <objProp> | |
| <name>saveConfig</name> | |
| <value class="SampleSaveConfiguration"> | |
| <time>true</time> | |
| <latency>true</latency> | |
| <timestamp>true</timestamp> | |
| <success>true</success> | |
| <label>true</label> | |
| <code>true</code> | |
| <message>true</message> | |
| <threadName>true</threadName> | |
| <dataType>true</dataType> | |
| <encoding>false</encoding> | |
| <assertions>true</assertions> | |
| <subresults>true</subresults> | |
| <responseData>false</responseData> | |
| <samplerData>false</samplerData> | |
| <xml>false</xml> | |
| <fieldNames>false</fieldNames> | |
| <responseHeaders>false</responseHeaders> | |
| <requestHeaders>false</requestHeaders> | |
| <responseDataOnError>false</responseDataOnError> | |
| <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> | |
| <assertionsResultsToSave>0</assertionsResultsToSave> | |
| <bytes>true</bytes> | |
| <threadCounts>true</threadCounts> | |
| </value> | |
| </objProp> | |
| <stringProp name="filename"></stringProp> | |
| </ResultCollector> | |
| <hashTree/> | |
| </hashTree> | |
| </hashTree> | |
| </hashTree> | |
| </jmeterTestPlan> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment