In JMeter 2.1.1, 403 redirects from https pages could be parsed by regular expression post processors. In JMeter 2.2, the same script seems to skip over the post processor step, leaving the variable as the string ${variable} instead of replacing it with the match or non-match contents. The following script correctly runs the RE extractor in 2.1.1, but not in 2.2. Feel free to trash this login...it's just a spam collector. Only the last (3rd) RE is relevant to the bug. The other two are just to setup the page. Also, this is just a public site I found to test this...please don't run any real load against it. <jmeterTestPlan version="1.1" properties="1.7"> <hashTree> <TestPlan> <elementProp name="TestPlan.user_defined_variables" elementType="org.apache.jmeter.config.Arguments"> <stringProp name="TestElement.gui_class">org.apache.jmeter.config.gui.ArgumentsPanel</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.config.Arguments</stringProp> <collectionProp name="Arguments.arguments"/> <stringProp name="TestElement.name">User Defined Variables</stringProp> <boolProp name="TestElement.enabled">true</boolProp> </elementProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.control.gui.TestPlanGui</stringProp> <stringProp name="TestPlan.user_define_classpath"></stringProp> <boolProp name="TestPlan.serialize_threadgroups">false</boolProp> <stringProp name="TestElement.test_class">org.apache.jmeter.testelement.TestPlan</stringProp> <stringProp name="TestElement.name">Test Plan</stringProp> <boolProp name="TestPlan.functional_mode">false</boolProp> <boolProp name="TestElement.enabled">true</boolProp> <stringProp name="TestPlan.comments"></stringProp> </TestPlan> <hashTree> <ThreadGroup> <longProp name="ThreadGroup.start_time">1158799693000</longProp> <stringProp name="TestElement.test_class">org.apache.jmeter.threads.ThreadGroup</stringProp> <stringProp name="ThreadGroup.delay"></stringProp> <stringProp name="ThreadGroup.duration"></stringProp> <boolProp name="TestElement.enabled">true</boolProp> <stringProp name="ThreadGroup.num_threads">1</stringProp> <boolProp name="ThreadGroup.scheduler">false</boolProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.threads.gui.ThreadGroupGui</stringProp> <elementProp name="ThreadGroup.main_controller" elementType="org.apache.jmeter.control.LoopController"> <stringProp name="TestElement.gui_class">org.apache.jmeter.control.gui.LoopControlPanel</stringProp> <stringProp name="LoopController.loops">1</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.control.LoopController</stringProp> <stringProp name="TestElement.name">Loop Controller</stringProp> <boolProp name="TestElement.enabled">true</boolProp> <boolProp name="LoopController.continue_forever">false</boolProp> </elementProp> <stringProp name="TestElement.name">Thread Group</stringProp> <longProp name="ThreadGroup.end_time">1158799693000</longProp> <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> <stringProp name="ThreadGroup.ramp_time">1</stringProp> </ThreadGroup> <hashTree> <HTTPSampler> <stringProp name="HTTPSampler.path">/login.srf</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <stringProp name="HTTPSampler.protocol">https</stringProp> <boolProp name="TestElement.enabled">true</boolProp> <boolProp name="HTTPSampler.follow_redirects">false</boolProp> <stringProp name="HTTPSampler.port">443</stringProp> <elementProp name="HTTPsampler.Arguments" elementType="org.apache.jmeter.config.Arguments"> <stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.config.Arguments</stringProp> <collectionProp name="Arguments.arguments"/> <stringProp name="TestElement.name">User Defined Variables</stringProp> <boolProp name="TestElement.enabled">true</boolProp> </elementProp> <stringProp name="HTTPSampler.mimetype"></stringProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</stringProp> <stringProp name="HTTPSampler.FILE_FIELD"></stringProp> <stringProp name="TestElement.name">HTTP Request</stringProp> <stringProp name="HTTPSampler.monitor">false</stringProp> <stringProp name="HTTPSampler.domain">login.live.com</stringProp> <stringProp name="HTTPSampler.FILE_NAME"></stringProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> </HTTPSampler> <hashTree> <RegexExtractor> <stringProp name="RegexExtractor.default">NO_MATCH</stringProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.extractor.gui.RegexExtractorGui</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.extractor.RegexExtractor</stringProp> <stringProp name="RegexExtractor.regex">name="PPFT" id="[^"]+" value="([^"]+)"</stringProp> <stringProp name="TestElement.name">Regular Expression Extractor</stringProp> <boolProp name="TestElement.enabled">true</boolProp> <stringProp name="RegexExtractor.useHeaders">false</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.match_number">1</stringProp> <stringProp name="RegexExtractor.refname">ppft</stringProp> </RegexExtractor> <hashTree/> <RegexExtractor> <stringProp name="RegexExtractor.default">NO_MATCH</stringProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.extractor.gui.RegexExtractorGui</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.extractor.RegexExtractor</stringProp> <stringProp name="RegexExtractor.regex">post\.srf\?bk=([^"]+)"</stringProp> <stringProp name="TestElement.name">Regular Expression Extractor</stringProp> <boolProp name="TestElement.enabled">true</boolProp> <stringProp name="RegexExtractor.useHeaders">false</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.match_number">1</stringProp> <stringProp name="RegexExtractor.refname">bk</stringProp> </RegexExtractor> <hashTree/> </hashTree> <HTTPSampler> <stringProp name="HTTPSampler.path">/ppsecure/post.srf?bk=${bk}</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <stringProp name="HTTPSampler.protocol">https</stringProp> <boolProp name="TestElement.enabled">true</boolProp> <boolProp name="HTTPSampler.follow_redirects">false</boolProp> <stringProp name="HTTPSampler.port">443</stringProp> <elementProp name="HTTPsampler.Arguments" elementType="org.apache.jmeter.config.Arguments"> <stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.config.Arguments</stringProp> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value">Passport</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">PPSX</stringProp> <boolProp name="HTTPArgument.always_encode">false</boolProp> </elementProp> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value"></stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">PwdPad</stringProp> <boolProp name="HTTPArgument.always_encode">false</boolProp> </elementProp> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value">dave420010@hotmail.com</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">login</stringProp> <boolProp name="HTTPArgument.always_encode">true</boolProp> </elementProp> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value">bbbbbb</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">passwd</stringProp> <boolProp name="HTTPArgument.always_encode">false</boolProp> </elementProp> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value"> Sign In </stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">SI</stringProp> <boolProp name="HTTPArgument.always_encode">false</boolProp> </elementProp> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value">3</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">LoginOptions</stringProp> <boolProp name="HTTPArgument.always_encode">false</boolProp> </elementProp> <elementProp name="" elementType="org.apache.jmeter.protocol.http.util.HTTPArgument"> <stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.value">${ppft}</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">PPFT</stringProp> <boolProp name="HTTPArgument.always_encode">false</boolProp> </elementProp> </collectionProp> <stringProp name="TestElement.name">User Defined Variables</stringProp> <boolProp name="TestElement.enabled">true</boolProp> </elementProp> <stringProp name="HTTPSampler.mimetype"></stringProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</stringProp> <stringProp name="HTTPSampler.FILE_FIELD"></stringProp> <stringProp name="TestElement.name">HTTP Request</stringProp> <stringProp name="HTTPSampler.monitor">false</stringProp> <stringProp name="HTTPSampler.domain">login.live.com</stringProp> <stringProp name="HTTPSampler.FILE_NAME"></stringProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> </HTTPSampler> <hashTree> <RegexExtractor> <stringProp name="RegexExtractor.default">NO_MATCH</stringProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.extractor.gui.RegexExtractorGui</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.extractor.RegexExtractor</stringProp> <stringProp name="RegexExtractor.regex">PPAuth=([^;]+)</stringProp> <stringProp name="TestElement.name">Regular Expression Extractor</stringProp> <boolProp name="TestElement.enabled">true</boolProp> <stringProp name="RegexExtractor.useHeaders">true</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.match_number">1</stringProp> <stringProp name="RegexExtractor.refname">variable</stringProp> </RegexExtractor> <hashTree/> </hashTree> <HTTPSampler> <stringProp name="HTTPSampler.path">${variable}</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <stringProp name="HTTPSampler.protocol"></stringProp> <boolProp name="TestElement.enabled">true</boolProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <stringProp name="HTTPSampler.port"></stringProp> <elementProp name="HTTPsampler.Arguments" elementType="org.apache.jmeter.config.Arguments"> <stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.config.Arguments</stringProp> <collectionProp name="Arguments.arguments"/> <stringProp name="TestElement.name">User Defined Variables</stringProp> <boolProp name="TestElement.enabled">true</boolProp> </elementProp> <stringProp name="HTTPSampler.mimetype"></stringProp> <stringProp name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</stringProp> <stringProp name="HTTPSampler.FILE_FIELD"></stringProp> <stringProp name="TestElement.name">HTTP Request</stringProp> <stringProp name="HTTPSampler.monitor">false</stringProp> <stringProp name="HTTPSampler.domain">localhost</stringProp> <stringProp name="HTTPSampler.FILE_NAME"></stringProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> </HTTPSampler> <hashTree/> <ResultCollector> <stringProp name="TestElement.gui_class">org.apache.jmeter.visualizers.ViewResultsFullVisualizer</stringProp> <stringProp name="TestElement.test_class">org.apache.jmeter.reporters.ResultCollector</stringProp> <stringProp name="TestElement.name">View Results Tree</stringProp> <objProp> <value class="org.apache.jmeter.samplers.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>false</dataType> <encoding>false</encoding> <assertions>true</assertions> <subresults>true</subresults> <responseData>true</responseData> <samplerData>false</samplerData> <xml>true</xml> <fieldNames>false</fieldNames> <responseHeaders>false</responseHeaders> <requestHeaders>false</requestHeaders> <responseDataOnError>true</responseDataOnError> <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> <assertionsResultsToSave>0</assertionsResultsToSave> <delimiter>,</delimiter> <printMilliseconds>true</printMilliseconds> </value> <samplerData>false</samplerData> <xml>true</xml> <fieldNames>false</fieldNames> <responseHeaders>false</responseHeaders> <requestHeaders>false</requestHeaders> <responseDataOnError>true</responseDataOnError> <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> <assertionsResultsToSave>0</assertionsResultsToSave> <delimiter>,</delimiter> <printMilliseconds>true</printMilliseconds> </value> <name>saveConfig</name> </objProp> <boolProp name="TestElement.enabled">true</boolProp> <stringProp name="filename"></stringProp> <boolProp name="ResultCollector.error_logging">false</boolProp> </ResultCollector> <hashTree/> </hashTree> </hashTree> </hashTree> </jmeterTestPlan>
Created attachment 18895 [details] This script runs correctly in 2.1.1, but not in 2.2. Sorry, I didn't know I could attach a file after the initial comments.
The RE code was changed in 2.2 to check for responseData length = 0, rather than checking it for null. Both checks are wrong, as there is no need to check the body if the RE is matching against the Headers or URL, but presumably the responseData was not null in 2.1.1. The solution is to remove the data length check, and let the RE run against an empty body if necessary. Fix applied to 2.2 branch; it is in the nightly version: 2-2.20060921 Please let us know if whether or not this fixes the problem.
The checked-in code fixes the problem in the example script and my original script. Thanks!
*** Bug 41571 has been marked as a duplicate of this bug. ***