0
votes

From the below string

https://ABC.somewebsitename.com/Account/AutoLogOn?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMDEyMzk3ODMiLCJ0YXJnZXRDb3VudHJ5Q29kZSI6IkpQIiwiZXhwIjoiMTU3OTUxMjc4MiJ9.QhfDKvZXSrqTjGYsBaZUd6ErbYoOJUdta0efws2SI-nv0VYqUvByHvoKbWVGvd89RmOi-KV33CDHU8NE_Pl0NA

I want to extract the value after token and send it as a parameter in next request for that I used Regular Expression extractor as below

enter image description here

But in the next request parameter, I am not able to get those values enter image description here Am I missing something, can you help me on this?

Note: I have followed the link Extract Location from Response Header with JMeter but still no use.

3

3 Answers

1
votes

Your regular expression is missing capturing group, I believe you should amend it like:

https.+token=(.*)

Demo:

enter image description here

However if you just need to extract the token and append it to the next request it is easier to consider Using the HTTP URL Re-writing Modifier

0
votes

enter image description here

Regular expression should be token=(.+?)$

Also set the Field to Check to URL in the Regular Expression Extractor element.

0
votes

I did some trial and error, and got the answer,
In the Regular Expression Extractor, used as

  • Regular Expression: Location: .+\/AutoLogOn\?token=(.*?)\n