Author: pmouawad
Date: Sat May 12 20:05:32 2018
New Revision: 1831493

URL: http://svn.apache.org/viewvc?rev=1831493&view=rev
Log:
Fix TestRedirectionPolicies failures due to spaces randomly added in response.
Use JSON extractor for more reliability

Modified:
    jmeter/trunk/bin/testfiles/TestRedirectionPolicies.jmx
    jmeter/trunk/bin/testfiles/TestRedirectionPolicies.xml

Modified: jmeter/trunk/bin/testfiles/TestRedirectionPolicies.jmx
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/TestRedirectionPolicies.jmx?rev=1831493&r1=1831492&r2=1831493&view=diff
==============================================================================
--- jmeter/trunk/bin/testfiles/TestRedirectionPolicies.jmx (original)
+++ jmeter/trunk/bin/testfiles/TestRedirectionPolicies.jmx Sat May 12 20:05:32 
2018
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.1-SNAPSHOT.20180421">
+<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.1-SNAPSHOT.20180512">
   <hashTree>
     <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" 
enabled="true">
       <stringProp name="TestPlan.comments"></stringProp>
@@ -58,16 +58,6 @@
           <stringProp name="HTTPSampler.response_timeout"></stringProp>
         </HTTPSamplerProxy>
         <hashTree>
-          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
-            <collectionProp name="Asserion.test_strings">
-              <stringProp name="-1256052303">&quot;url&quot;: 
&quot;http://httpbin.org/get&quot;</stringProp>
-            </collectionProp>
-            <stringProp name="Assertion.custom_message"></stringProp>
-            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
-            <boolProp name="Assertion.assume_success">false</boolProp>
-            <intProp name="Assertion.test_type">16</intProp>
-          </ResponseAssertion>
-          <hashTree/>
           <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_200" enabled="true">
             <collectionProp name="Asserion.test_strings">
               <stringProp name="49586">200</stringProp>
@@ -86,6 +76,25 @@
             <stringProp name="scriptLanguage">groovy</stringProp>
           </JSR223Assertion>
           <hashTree/>
+          <JSONPostProcessor guiclass="JSONPostProcessorGui" 
testclass="JSONPostProcessor" testname="JR_url" enabled="true">
+            <stringProp 
name="JSONPostProcessor.referenceNames">url</stringProp>
+            <stringProp 
name="JSONPostProcessor.jsonPathExprs">$..url</stringProp>
+            <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>
+            <stringProp 
name="JSONPostProcessor.defaultValues">nv_url</stringProp>
+          </JSONPostProcessor>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp 
name="-1578524182">http://httpbin.org/get</stringProp>
+            </collectionProp>
+            <stringProp name="Assertion.custom_message"></stringProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">url</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
         </hashTree>
         <HTTPSamplerProxy guiclass="HttpTestSampleGui" 
testclass="HTTPSamplerProxy" testname="HR_NoAutoRedirect" enabled="true">
           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" 
guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined 
Variables" enabled="true">
@@ -144,16 +153,6 @@
           <stringProp name="HTTPSampler.response_timeout"></stringProp>
         </HTTPSamplerProxy>
         <hashTree>
-          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
-            <collectionProp name="Asserion.test_strings">
-              <stringProp name="-1256052303">&quot;url&quot;: 
&quot;http://httpbin.org/get&quot;</stringProp>
-            </collectionProp>
-            <stringProp name="Assertion.custom_message"></stringProp>
-            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
-            <boolProp name="Assertion.assume_success">false</boolProp>
-            <intProp name="Assertion.test_type">16</intProp>
-          </ResponseAssertion>
-          <hashTree/>
           <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_200" enabled="true">
             <collectionProp name="Asserion.test_strings">
               <stringProp name="49586">200</stringProp>
@@ -172,6 +171,25 @@
             <stringProp name="scriptLanguage">groovy</stringProp>
           </JSR223Assertion>
           <hashTree/>
+          <JSONPostProcessor guiclass="JSONPostProcessorGui" 
testclass="JSONPostProcessor" testname="JR_url" enabled="true">
+            <stringProp 
name="JSONPostProcessor.referenceNames">url</stringProp>
+            <stringProp 
name="JSONPostProcessor.jsonPathExprs">$..url</stringProp>
+            <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>
+            <stringProp 
name="JSONPostProcessor.defaultValues">nv_url</stringProp>
+          </JSONPostProcessor>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp 
name="-1578524182">http://httpbin.org/get</stringProp>
+            </collectionProp>
+            <stringProp name="Assertion.custom_message"></stringProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">url</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
         </hashTree>
       </hashTree>
       <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" 
testname="TG2" enabled="true">
@@ -244,16 +262,6 @@
           <stringProp name="HTTPSampler.response_timeout"></stringProp>
         </HTTPSamplerProxy>
         <hashTree>
-          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
-            <collectionProp name="Asserion.test_strings">
-              <stringProp name="-1256052303">&quot;url&quot;: 
&quot;http://httpbin.org/get&quot;</stringProp>
-            </collectionProp>
-            <stringProp name="Assertion.custom_message"></stringProp>
-            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
-            <boolProp name="Assertion.assume_success">false</boolProp>
-            <intProp name="Assertion.test_type">16</intProp>
-          </ResponseAssertion>
-          <hashTree/>
           <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_200" enabled="true">
             <collectionProp name="Asserion.test_strings">
               <stringProp name="49586">200</stringProp>
@@ -272,6 +280,25 @@
             <stringProp name="scriptLanguage">groovy</stringProp>
           </JSR223Assertion>
           <hashTree/>
+          <JSONPostProcessor guiclass="JSONPostProcessorGui" 
testclass="JSONPostProcessor" testname="JR_url" enabled="true">
+            <stringProp 
name="JSONPostProcessor.referenceNames">url</stringProp>
+            <stringProp 
name="JSONPostProcessor.jsonPathExprs">$..url</stringProp>
+            <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>
+            <stringProp 
name="JSONPostProcessor.defaultValues">nv_url</stringProp>
+          </JSONPostProcessor>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp 
name="-1578524182">http://httpbin.org/get</stringProp>
+            </collectionProp>
+            <stringProp name="Assertion.custom_message"></stringProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">url</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
         </hashTree>
         <HTTPSamplerProxy guiclass="HttpTestSampleGui" 
testclass="HTTPSamplerProxy" testname="HR_AutoRedirect" enabled="true">
           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" 
guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined 
Variables" enabled="true">
@@ -292,16 +319,6 @@
           <stringProp name="HTTPSampler.response_timeout"></stringProp>
         </HTTPSamplerProxy>
         <hashTree>
-          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
-            <collectionProp name="Asserion.test_strings">
-              <stringProp name="-1256052303">&quot;url&quot;: 
&quot;http://httpbin.org/get&quot;</stringProp>
-            </collectionProp>
-            <stringProp name="Assertion.custom_message"></stringProp>
-            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
-            <boolProp name="Assertion.assume_success">false</boolProp>
-            <intProp name="Assertion.test_type">16</intProp>
-          </ResponseAssertion>
-          <hashTree/>
           <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_200" enabled="true">
             <collectionProp name="Asserion.test_strings">
               <stringProp name="49586">200</stringProp>
@@ -320,6 +337,25 @@
             <stringProp name="scriptLanguage">groovy</stringProp>
           </JSR223Assertion>
           <hashTree/>
+          <JSONPostProcessor guiclass="JSONPostProcessorGui" 
testclass="JSONPostProcessor" testname="JR_url" enabled="true">
+            <stringProp 
name="JSONPostProcessor.referenceNames">url</stringProp>
+            <stringProp 
name="JSONPostProcessor.jsonPathExprs">$..url</stringProp>
+            <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>
+            <stringProp 
name="JSONPostProcessor.defaultValues">nv_url</stringProp>
+          </JSONPostProcessor>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_Redirected" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp 
name="-1578524182">http://httpbin.org/get</stringProp>
+            </collectionProp>
+            <stringProp name="Assertion.custom_message"></stringProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">url</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
         </hashTree>
       </hashTree>
       <ResultCollector guiclass="ViewResultsFullVisualizer" 
testclass="ResultCollector" testname="View Results Tree" enabled="true">
@@ -384,6 +420,46 @@
         <stringProp name="filename">TestRedirectionPolicies.xml</stringProp>
       </ResultCollector>
       <hashTree/>
+      <ResultCollector guiclass="ViewResultsFullVisualizer" 
testclass="ResultCollector" testname="VRT-DetailsOnError" enabled="true">
+        <boolProp name="ResultCollector.error_logging">true</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>true</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>true</responseData>
+            <samplerData>true</samplerData>
+            <xml>true</xml>
+            <fieldNames>false</fieldNames>
+            <responseHeaders>true</responseHeaders>
+            <requestHeaders>true</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+            <bytes>true</bytes>
+            <sentBytes>true</sentBytes>
+            <url>true</url>
+            <fileName>true</fileName>
+            <hostname>true</hostname>
+            <threadCounts>true</threadCounts>
+            <sampleCount>true</sampleCount>
+            <idleTime>true</idleTime>
+            <connectTime>true</connectTime>
+          </value>
+        </objProp>
+        <stringProp 
name="filename">TestRedirectionPolicies-errors.xml</stringProp>
+      </ResultCollector>
+      <hashTree/>
     </hashTree>
   </hashTree>
 </jmeterTestPlan>

Modified: jmeter/trunk/bin/testfiles/TestRedirectionPolicies.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/TestRedirectionPolicies.xml?rev=1831493&r1=1831492&r2=1831493&view=diff
==============================================================================
--- jmeter/trunk/bin/testfiles/TestRedirectionPolicies.xml (original)
+++ jmeter/trunk/bin/testfiles/TestRedirectionPolicies.xml Sat May 12 20:05:32 
2018
@@ -2,17 +2,17 @@
 <testResults version="1.2">
 <httpSample s="true" lb="HR_AutoRedirect" rc="200" rm="OK" dt="text">
   <assertionResult>
-    <name>RA_Redirected</name>
+    <name>RA_200</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>RA_200</name>
+    <name>JSA_0SR</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>JSA_0SR</name>
+    <name>RA_Redirected</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
@@ -31,17 +31,17 @@
 </httpSample>
 <httpSample s="true" lb="HR_FollowRedirect" rc="200" rm="OK" dt="text">
   <assertionResult>
-    <name>RA_Redirected</name>
+    <name>RA_200</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>RA_200</name>
+    <name>JSA_2SR</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>JSA_2SR</name>
+    <name>RA_Redirected</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
@@ -62,17 +62,17 @@
 </httpSample>
 <httpSample s="true" lb="HR_FollowRedirect" rc="200" rm="OK" dt="text">
   <assertionResult>
-    <name>RA_Redirected</name>
+    <name>RA_200</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>RA_200</name>
+    <name>JSA_2SR</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>JSA_2SR</name>
+    <name>RA_Redirected</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
@@ -81,17 +81,17 @@
 </httpSample>
 <httpSample s="true" lb="HR_AutoRedirect" rc="200" rm="OK" dt="text">
   <assertionResult>
-    <name>RA_Redirected</name>
+    <name>RA_200</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>RA_200</name>
+    <name>JSA_0SR</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>
   <assertionResult>
-    <name>JSA_0SR</name>
+    <name>RA_Redirected</name>
     <failure>false</failure>
     <error>false</error>
   </assertionResult>


Reply via email to