I want to pass the below RefreshTokenCredential in Header part.
After passing this token, I want to get the value of id_token which is showing in textview as shown below.
Please let me know how to pass this token in Jmeter and how to get the id_token?
2
To pass the token add HTTP Header Manager as a child of the request to which you want to add the token to and configure it like:
To extract the "id_token" value add CSS Selector Extractor as a child of that request and configure it like:
you will be able to use extracted value as ${id_token} where required
${id_token}
You have to add Header Manager to your script. Since you are getting token as part of HTML, you need to use Regex Extractor to get the token
Header Manager
Regex Extractor
Regex expression <input type="hidden" name="idToken" value="(.*?)">
<input type="hidden" name="idToken" value="(.*?)">
Setting Headers
Setting Regex
Regex test
Click here to cancel reply.
2
Answers
To pass the token add HTTP Header Manager as a child of the request to which you want to add the token to and configure it like:
To extract the "id_token" value add CSS Selector Extractor as a child of that request and configure it like:
you will be able to use extracted value as
${id_token}
where requiredYou have to add
Header Manager
to your script. Since you are getting token as part of HTML, you need to useRegex Extractor
to get the tokenRegex expression
<input type="hidden" name="idToken" value="(.*?)">
Setting Headers
Setting Regex
Regex test