0

eg. I've received below response, so how to extract the value after akk in jmeter

eg : url":"https://gmail.com/user/v1/akk/48c68457-df8a-44e6-bca3-3874f87b3b35"

3 Answers 3

1

You should use Regular Expression Extractor

To extract UUID from your responce try this regexp:

akk\/((\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1})\"

You can test and learn regular expressions here and here

2
  • Have tried Regular Expression Extractor but not able to extract the particular value after akk/
    – Akash
    Commented Dec 10, 2019 at 8:33
  • Your value looks like a UID, so you can use UID reg exp regextester.com/94410 Commented Dec 10, 2019 at 9:08
1
  1. Add Regular Expression Extractor as a child of the request which returns above response
  2. Configure it as follows:

    • Name of created variable: anything meaningful, i.e. akk
    • Regular Expression: /akk/(.+?)"
    • Template: $1$

      enter image description here

  3. That should be it, now you should be able to access the extracted value as ${akk} where required

    enter image description here

    Regular expression explanation:

    • . - match any character
    • + - one or more times
    • ? - don't be greedy, i.e. stop when first match succeeds
    • ()- grouping

More information:

0
0

How about trying the Boundary Extractor?

Here, you'd set the left boundary as akk/ and the right boundary as "

That'd extract the content in between. I've used these before and they work quite nicely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.