How to use token id(value) from html response in jmeter correlation
Just leaning correlation, Please help me how to user token id under jmeter , i am using token id then getting error,
Please help me.
Website link is : https://opensource-demo.orangehrmlive.com/
and credentials : ( Username : Admin | Password : admin123 )
Attached images for reference purpose.
selenium testing jmeter qa
add a comment |
Just leaning correlation, Please help me how to user token id under jmeter , i am using token id then getting error,
Please help me.
Website link is : https://opensource-demo.orangehrmlive.com/
and credentials : ( Username : Admin | Password : admin123 )
Attached images for reference purpose.
selenium testing jmeter qa
Show your Json extractor configuration
– Adnan
Nov 21 '18 at 10:32
this is request:POST opensource-demo.orangehrmlive.com/index.php/auth/… POST data: actionID=&hdnUserTimeZoneOffset=5.5&_csrf_token=a835427641afe9c7916d3221328f245c&txtUsername=Admin&txtPassword=admin123&Submit=LOGIN Cookie Data: PHPSESSID=ubo8lut3ajcvu17073c2msn6d6 Request Headers: Connection: keep-alive
– Saurabh Gupta
Nov 21 '18 at 10:36
this is response data token info: <form id="frmLogin" method="post" action="/index.php/auth/validateCredentials"> <input type="hidden" name="actionID"/> <input type="hidden" name="hdnUserTimeZoneOffset" id="hdnUserTimeZoneOffset" value="0" /> <input type="hidden" name="_csrf_token" value="a835427641afe9c7916d3221328f245c" id="csrf_token" /> <div id="logInPanelHeading">LOGIN Panel</div>
– Saurabh Gupta
Nov 21 '18 at 10:39
add a comment |
Just leaning correlation, Please help me how to user token id under jmeter , i am using token id then getting error,
Please help me.
Website link is : https://opensource-demo.orangehrmlive.com/
and credentials : ( Username : Admin | Password : admin123 )
Attached images for reference purpose.
selenium testing jmeter qa
Just leaning correlation, Please help me how to user token id under jmeter , i am using token id then getting error,
Please help me.
Website link is : https://opensource-demo.orangehrmlive.com/
and credentials : ( Username : Admin | Password : admin123 )
Attached images for reference purpose.
selenium testing jmeter qa
selenium testing jmeter qa
edited Nov 22 '18 at 9:36
Saurabh Gupta
asked Nov 21 '18 at 10:28
Saurabh GuptaSaurabh Gupta
661412
661412
Show your Json extractor configuration
– Adnan
Nov 21 '18 at 10:32
this is request:POST opensource-demo.orangehrmlive.com/index.php/auth/… POST data: actionID=&hdnUserTimeZoneOffset=5.5&_csrf_token=a835427641afe9c7916d3221328f245c&txtUsername=Admin&txtPassword=admin123&Submit=LOGIN Cookie Data: PHPSESSID=ubo8lut3ajcvu17073c2msn6d6 Request Headers: Connection: keep-alive
– Saurabh Gupta
Nov 21 '18 at 10:36
this is response data token info: <form id="frmLogin" method="post" action="/index.php/auth/validateCredentials"> <input type="hidden" name="actionID"/> <input type="hidden" name="hdnUserTimeZoneOffset" id="hdnUserTimeZoneOffset" value="0" /> <input type="hidden" name="_csrf_token" value="a835427641afe9c7916d3221328f245c" id="csrf_token" /> <div id="logInPanelHeading">LOGIN Panel</div>
– Saurabh Gupta
Nov 21 '18 at 10:39
add a comment |
Show your Json extractor configuration
– Adnan
Nov 21 '18 at 10:32
this is request:POST opensource-demo.orangehrmlive.com/index.php/auth/… POST data: actionID=&hdnUserTimeZoneOffset=5.5&_csrf_token=a835427641afe9c7916d3221328f245c&txtUsername=Admin&txtPassword=admin123&Submit=LOGIN Cookie Data: PHPSESSID=ubo8lut3ajcvu17073c2msn6d6 Request Headers: Connection: keep-alive
– Saurabh Gupta
Nov 21 '18 at 10:36
this is response data token info: <form id="frmLogin" method="post" action="/index.php/auth/validateCredentials"> <input type="hidden" name="actionID"/> <input type="hidden" name="hdnUserTimeZoneOffset" id="hdnUserTimeZoneOffset" value="0" /> <input type="hidden" name="_csrf_token" value="a835427641afe9c7916d3221328f245c" id="csrf_token" /> <div id="logInPanelHeading">LOGIN Panel</div>
– Saurabh Gupta
Nov 21 '18 at 10:39
Show your Json extractor configuration
– Adnan
Nov 21 '18 at 10:32
Show your Json extractor configuration
– Adnan
Nov 21 '18 at 10:32
this is request:POST opensource-demo.orangehrmlive.com/index.php/auth/… POST data: actionID=&hdnUserTimeZoneOffset=5.5&_csrf_token=a835427641afe9c7916d3221328f245c&txtUsername=Admin&txtPassword=admin123&Submit=LOGIN Cookie Data: PHPSESSID=ubo8lut3ajcvu17073c2msn6d6 Request Headers: Connection: keep-alive
– Saurabh Gupta
Nov 21 '18 at 10:36
this is request:POST opensource-demo.orangehrmlive.com/index.php/auth/… POST data: actionID=&hdnUserTimeZoneOffset=5.5&_csrf_token=a835427641afe9c7916d3221328f245c&txtUsername=Admin&txtPassword=admin123&Submit=LOGIN Cookie Data: PHPSESSID=ubo8lut3ajcvu17073c2msn6d6 Request Headers: Connection: keep-alive
– Saurabh Gupta
Nov 21 '18 at 10:36
this is response data token info: <form id="frmLogin" method="post" action="/index.php/auth/validateCredentials"> <input type="hidden" name="actionID"/> <input type="hidden" name="hdnUserTimeZoneOffset" id="hdnUserTimeZoneOffset" value="0" /> <input type="hidden" name="_csrf_token" value="a835427641afe9c7916d3221328f245c" id="csrf_token" /> <div id="logInPanelHeading">LOGIN Panel</div>
– Saurabh Gupta
Nov 21 '18 at 10:39
this is response data token info: <form id="frmLogin" method="post" action="/index.php/auth/validateCredentials"> <input type="hidden" name="actionID"/> <input type="hidden" name="hdnUserTimeZoneOffset" id="hdnUserTimeZoneOffset" value="0" /> <input type="hidden" name="_csrf_token" value="a835427641afe9c7916d3221328f245c" id="csrf_token" /> <div id="logInPanelHeading">LOGIN Panel</div>
– Saurabh Gupta
Nov 21 '18 at 10:39
add a comment |
1 Answer
1
active
oldest
votes
The response is not JSON, it's normal HTML so you should be using CSS Selector Extractor in order to get the value of the _csrf_token
hidden input field
Design your test plan as follows:
- Add HTTP Request sampler which will send simple GET request to the https://opensource-demo.orangehrmlive.com/ page
- Add CSS Selector Extractor as a child of the above request
Configure it as follows:
- Name of created variable:
tokenid
- CSS Selector Expression:
form[id=frmLogin] > input[id=csrf_token]
Attribute:
value
Demo:
- Name of created variable:
- Add the request which is at your screenshot to be after the first GET request
See How to Handle Correlation in JMeter article to learn more about handling dynamic data in your JMeter tests.
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410051%2fhow-to-use-token-idvalue-from-html-response-in-jmeter-correlation%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
The response is not JSON, it's normal HTML so you should be using CSS Selector Extractor in order to get the value of the _csrf_token
hidden input field
Design your test plan as follows:
- Add HTTP Request sampler which will send simple GET request to the https://opensource-demo.orangehrmlive.com/ page
- Add CSS Selector Extractor as a child of the above request
Configure it as follows:
- Name of created variable:
tokenid
- CSS Selector Expression:
form[id=frmLogin] > input[id=csrf_token]
Attribute:
value
Demo:
- Name of created variable:
- Add the request which is at your screenshot to be after the first GET request
See How to Handle Correlation in JMeter article to learn more about handling dynamic data in your JMeter tests.
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
add a comment |
The response is not JSON, it's normal HTML so you should be using CSS Selector Extractor in order to get the value of the _csrf_token
hidden input field
Design your test plan as follows:
- Add HTTP Request sampler which will send simple GET request to the https://opensource-demo.orangehrmlive.com/ page
- Add CSS Selector Extractor as a child of the above request
Configure it as follows:
- Name of created variable:
tokenid
- CSS Selector Expression:
form[id=frmLogin] > input[id=csrf_token]
Attribute:
value
Demo:
- Name of created variable:
- Add the request which is at your screenshot to be after the first GET request
See How to Handle Correlation in JMeter article to learn more about handling dynamic data in your JMeter tests.
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
add a comment |
The response is not JSON, it's normal HTML so you should be using CSS Selector Extractor in order to get the value of the _csrf_token
hidden input field
Design your test plan as follows:
- Add HTTP Request sampler which will send simple GET request to the https://opensource-demo.orangehrmlive.com/ page
- Add CSS Selector Extractor as a child of the above request
Configure it as follows:
- Name of created variable:
tokenid
- CSS Selector Expression:
form[id=frmLogin] > input[id=csrf_token]
Attribute:
value
Demo:
- Name of created variable:
- Add the request which is at your screenshot to be after the first GET request
See How to Handle Correlation in JMeter article to learn more about handling dynamic data in your JMeter tests.
The response is not JSON, it's normal HTML so you should be using CSS Selector Extractor in order to get the value of the _csrf_token
hidden input field
Design your test plan as follows:
- Add HTTP Request sampler which will send simple GET request to the https://opensource-demo.orangehrmlive.com/ page
- Add CSS Selector Extractor as a child of the above request
Configure it as follows:
- Name of created variable:
tokenid
- CSS Selector Expression:
form[id=frmLogin] > input[id=csrf_token]
Attribute:
value
Demo:
- Name of created variable:
- Add the request which is at your screenshot to be after the first GET request
See How to Handle Correlation in JMeter article to learn more about handling dynamic data in your JMeter tests.
answered Nov 21 '18 at 12:24
Dmitri TDmitri T
71.3k33661
71.3k33661
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
add a comment |
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
Thanks alots, issue fixed able to login.
– Saurabh Gupta
Nov 22 '18 at 6:42
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
@dmritri T, can you plz let me know how to use regular expression extractor for this problem , is there any solution wrining this regular expression like this : Regular expression: name="_csrf_token" value="(.+?)" id="csrf_token" and variable : token and template : $1$. Please help me. Thanks,
– Saurabh Gupta
Nov 22 '18 at 8:37
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410051%2fhow-to-use-token-idvalue-from-html-response-in-jmeter-correlation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Show your Json extractor configuration
– Adnan
Nov 21 '18 at 10:32
this is request:POST opensource-demo.orangehrmlive.com/index.php/auth/… POST data: actionID=&hdnUserTimeZoneOffset=5.5&_csrf_token=a835427641afe9c7916d3221328f245c&txtUsername=Admin&txtPassword=admin123&Submit=LOGIN Cookie Data: PHPSESSID=ubo8lut3ajcvu17073c2msn6d6 Request Headers: Connection: keep-alive
– Saurabh Gupta
Nov 21 '18 at 10:36
this is response data token info: <form id="frmLogin" method="post" action="/index.php/auth/validateCredentials"> <input type="hidden" name="actionID"/> <input type="hidden" name="hdnUserTimeZoneOffset" id="hdnUserTimeZoneOffset" value="0" /> <input type="hidden" name="_csrf_token" value="a835427641afe9c7916d3221328f245c" id="csrf_token" /> <div id="logInPanelHeading">LOGIN Panel</div>
– Saurabh Gupta
Nov 21 '18 at 10:39