0
votes

I am using Regular Expression Extractor for extracting the header values. Here is my test plan structure. enter image description here

I am getting a response in login api is enter image description here

I want to extract the SRToke, Id1, Id2 and Id3 values from above response header. So I have used Regular Expression Extractor as below enter image description here

I have also used BeanShell PostProcessor enter image description here

Now I am getting the error 401 in result enter image description here

Please give me the solution, what I have done wrong here?

3

3 Answers

0
votes

First you need to extract the variables from Response Header section of your Login request. Please refer how to capture from here. https://stackoverflow.com/a/57391175/4481179

After extracting, use HTTP Header Manager as a child of Eventlist Sampler and pass that extracted value as shown below:

enter image description here

0
votes

You get an error about 401 because you did not add authorized success. You need to know the flow of the system. Maybe its need another parameter beside one parameter BEARER like you.

-1
votes

I think Beanshell won't be required as you are not correlating from cookies, try to find the missing header under the 401 transaction something like Authorization and place the correlated variable there.