0
votes

I did read few responses but my regular expression extractor is not working.

  • Mine is a simple case where this is my response

token.id=AQIC5wM2LY4Sfcz4cOT2RrremxWJmM3llZmPl6k0bP_r5D4.AAJTSQACMDUAAlNLABQtNDI1OTg4NzgxODg5MDM1ODU2NQACUzEAAjI3

  • I am trying to grab the value using this expression

    token.id="(.*?)"

which is not saving the value into the variable i assigned. My next request when trying to use the value fails since its not grabbing it. Can someone let me know what exactly is missing. thanks.

1

1 Answers

0
votes

There are few problems with your regular expression:

  1. You need to escape dot between "token" and "id" with backslash as it is a special character. See Literal Characters article for more information.
  2. You don't need the quotations marks as your response doesn't contain them (does it?)

So your regular expression needs to be amended as token\.id=(.*) (however I would rather go for something like token\.id=(\w.+)

You can use View Results Tree listener in "RegExp Tester" mode to test your regular expressions directly against response without having to re-run the request.

RegExp Tester

See Regular Expressions JMeter documentation chapter and How to debug your Apache JMeter script guide for extended information on the above approaches.