Correlated variable not getting evaluated











up vote
1
down vote

favorite












I have created an regular expression to extract CSRF token from the HTTP Headers and storing the value in the reference name CSRF_TOKEN by following this How to Load Test CSRF-Protected Web Sites



I using this variable in POST Parameters of another HttpRequest as below



csrfmiddlewaretoken=${CSRF_TOKEN}


Here ${CSRF_TOKEN} is not getting evaluated and the server is getting the middleware token as csrfmiddlewaretoken=%24%7BCSRF_TOKEN%7D



enter image description here



enter image description here










share|improve this question
























  • can you show your regular expression extractor ?
    – UBIK LOAD PACK
    Nov 10 at 22:02










  • in addition to @UBIK LOAD PACK requested, can you also please post the response which you are using to extract the value
    – M Navneet Krishna
    Nov 11 at 6:30












  • Here is my regular expression after my fix: Set-Cookie: csrftoken=(.+?); And the response headers are HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-Frame-Options: SAMEORIGIN Vary: Cookie Content-Length: 21901 Set-Cookie: csrftoken=R03ysqEIIn0NVFjQchFjTxdXYfwl37AIFUyTO9lElMBishgu8ao0SoJqZlEoinXO; expires=Sat, 09-Nov-2019 21:18:33 GMT; Max-Age=31449600; Path=/
    – Murthy
    Nov 11 at 7:38















up vote
1
down vote

favorite












I have created an regular expression to extract CSRF token from the HTTP Headers and storing the value in the reference name CSRF_TOKEN by following this How to Load Test CSRF-Protected Web Sites



I using this variable in POST Parameters of another HttpRequest as below



csrfmiddlewaretoken=${CSRF_TOKEN}


Here ${CSRF_TOKEN} is not getting evaluated and the server is getting the middleware token as csrfmiddlewaretoken=%24%7BCSRF_TOKEN%7D



enter image description here



enter image description here










share|improve this question
























  • can you show your regular expression extractor ?
    – UBIK LOAD PACK
    Nov 10 at 22:02










  • in addition to @UBIK LOAD PACK requested, can you also please post the response which you are using to extract the value
    – M Navneet Krishna
    Nov 11 at 6:30












  • Here is my regular expression after my fix: Set-Cookie: csrftoken=(.+?); And the response headers are HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-Frame-Options: SAMEORIGIN Vary: Cookie Content-Length: 21901 Set-Cookie: csrftoken=R03ysqEIIn0NVFjQchFjTxdXYfwl37AIFUyTO9lElMBishgu8ao0SoJqZlEoinXO; expires=Sat, 09-Nov-2019 21:18:33 GMT; Max-Age=31449600; Path=/
    – Murthy
    Nov 11 at 7:38













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have created an regular expression to extract CSRF token from the HTTP Headers and storing the value in the reference name CSRF_TOKEN by following this How to Load Test CSRF-Protected Web Sites



I using this variable in POST Parameters of another HttpRequest as below



csrfmiddlewaretoken=${CSRF_TOKEN}


Here ${CSRF_TOKEN} is not getting evaluated and the server is getting the middleware token as csrfmiddlewaretoken=%24%7BCSRF_TOKEN%7D



enter image description here



enter image description here










share|improve this question















I have created an regular expression to extract CSRF token from the HTTP Headers and storing the value in the reference name CSRF_TOKEN by following this How to Load Test CSRF-Protected Web Sites



I using this variable in POST Parameters of another HttpRequest as below



csrfmiddlewaretoken=${CSRF_TOKEN}


Here ${CSRF_TOKEN} is not getting evaluated and the server is getting the middleware token as csrfmiddlewaretoken=%24%7BCSRF_TOKEN%7D



enter image description here



enter image description here







jmeter load-testing jmeter-plugins






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 20:17









jonrsharpe

76k1098203




76k1098203










asked Nov 10 at 20:15









Murthy

616




616












  • can you show your regular expression extractor ?
    – UBIK LOAD PACK
    Nov 10 at 22:02










  • in addition to @UBIK LOAD PACK requested, can you also please post the response which you are using to extract the value
    – M Navneet Krishna
    Nov 11 at 6:30












  • Here is my regular expression after my fix: Set-Cookie: csrftoken=(.+?); And the response headers are HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-Frame-Options: SAMEORIGIN Vary: Cookie Content-Length: 21901 Set-Cookie: csrftoken=R03ysqEIIn0NVFjQchFjTxdXYfwl37AIFUyTO9lElMBishgu8ao0SoJqZlEoinXO; expires=Sat, 09-Nov-2019 21:18:33 GMT; Max-Age=31449600; Path=/
    – Murthy
    Nov 11 at 7:38


















  • can you show your regular expression extractor ?
    – UBIK LOAD PACK
    Nov 10 at 22:02










  • in addition to @UBIK LOAD PACK requested, can you also please post the response which you are using to extract the value
    – M Navneet Krishna
    Nov 11 at 6:30












  • Here is my regular expression after my fix: Set-Cookie: csrftoken=(.+?); And the response headers are HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-Frame-Options: SAMEORIGIN Vary: Cookie Content-Length: 21901 Set-Cookie: csrftoken=R03ysqEIIn0NVFjQchFjTxdXYfwl37AIFUyTO9lElMBishgu8ao0SoJqZlEoinXO; expires=Sat, 09-Nov-2019 21:18:33 GMT; Max-Age=31449600; Path=/
    – Murthy
    Nov 11 at 7:38
















can you show your regular expression extractor ?
– UBIK LOAD PACK
Nov 10 at 22:02




can you show your regular expression extractor ?
– UBIK LOAD PACK
Nov 10 at 22:02












in addition to @UBIK LOAD PACK requested, can you also please post the response which you are using to extract the value
– M Navneet Krishna
Nov 11 at 6:30






in addition to @UBIK LOAD PACK requested, can you also please post the response which you are using to extract the value
– M Navneet Krishna
Nov 11 at 6:30














Here is my regular expression after my fix: Set-Cookie: csrftoken=(.+?); And the response headers are HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-Frame-Options: SAMEORIGIN Vary: Cookie Content-Length: 21901 Set-Cookie: csrftoken=R03ysqEIIn0NVFjQchFjTxdXYfwl37AIFUyTO9lElMBishgu8ao0SoJqZlEoinXO; expires=Sat, 09-Nov-2019 21:18:33 GMT; Max-Age=31449600; Path=/
– Murthy
Nov 11 at 7:38




Here is my regular expression after my fix: Set-Cookie: csrftoken=(.+?); And the response headers are HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 X-Frame-Options: SAMEORIGIN Vary: Cookie Content-Length: 21901 Set-Cookie: csrftoken=R03ysqEIIn0NVFjQchFjTxdXYfwl37AIFUyTO9lElMBishgu8ao0SoJqZlEoinXO; expires=Sat, 09-Nov-2019 21:18:33 GMT; Max-Age=31449600; Path=/
– Murthy
Nov 11 at 7:38












1 Answer
1






active

oldest

votes

















up vote
2
down vote













It got resolved. I identified that, if the regular expression is not matching any value and there is no default value specified, then JMeter is not treating as a dynamic variable. I corrected it by fixing regular expression. it starts working. Thank you.






share|improve this answer





















  • you should accept your answer also.
    – UBIK LOAD PACK
    Nov 11 at 9:36











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243033%2fcorrelated-variable-not-getting-evaluated%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













It got resolved. I identified that, if the regular expression is not matching any value and there is no default value specified, then JMeter is not treating as a dynamic variable. I corrected it by fixing regular expression. it starts working. Thank you.






share|improve this answer





















  • you should accept your answer also.
    – UBIK LOAD PACK
    Nov 11 at 9:36















up vote
2
down vote













It got resolved. I identified that, if the regular expression is not matching any value and there is no default value specified, then JMeter is not treating as a dynamic variable. I corrected it by fixing regular expression. it starts working. Thank you.






share|improve this answer





















  • you should accept your answer also.
    – UBIK LOAD PACK
    Nov 11 at 9:36













up vote
2
down vote










up vote
2
down vote









It got resolved. I identified that, if the regular expression is not matching any value and there is no default value specified, then JMeter is not treating as a dynamic variable. I corrected it by fixing regular expression. it starts working. Thank you.






share|improve this answer












It got resolved. I identified that, if the regular expression is not matching any value and there is no default value specified, then JMeter is not treating as a dynamic variable. I corrected it by fixing regular expression. it starts working. Thank you.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 4:06









Murthy

616




616












  • you should accept your answer also.
    – UBIK LOAD PACK
    Nov 11 at 9:36


















  • you should accept your answer also.
    – UBIK LOAD PACK
    Nov 11 at 9:36
















you should accept your answer also.
– UBIK LOAD PACK
Nov 11 at 9:36




you should accept your answer also.
– UBIK LOAD PACK
Nov 11 at 9:36


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243033%2fcorrelated-variable-not-getting-evaluated%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues