Regular expression extractor error - JMETER

Asked

Viewed 96 times

0

Good afternoon, everyone,

I am unable to extract a data returned in the callback parameter in the GET HTTP - JMETER service. Could someone help?

Goes below:

JSON returned in call:

{
  "wallets" : [ {
    "id" : "eyJpZGVudGl0eSI6WzQ4LDQyLDQ4LDUsNiwzLDQzLDEwMSwxMTIsMywzMywwLC0zMCw4MSwxMDQsMCw2NywtMTcsNDcsLTM0LC0yNiwtNDksLTg0LDkxLC0xMDgsMTcsMjUsMTksLTcxLC0xMTcsLTEwMywzNSwtMjEsNDAsLTcyLDY3LDEwNSwxMCwtNDAsMTE3LC0xMTEsLTEwLDExNiwtNThdLCJ2ZXJzaW9uIjoiMC4xLjEifQ=="
  } ]
}

I need to get data from "id".

I have tried several ways, but without success!

I await and thank you in advance!!!!!

1 answer

1


First option

Following regex will return info on id:

id"\s*:\s*"([\w=]*)"

Steps to work:

  • Use that expression in the field Regular Expression
  • Put the value 1 in the field Match No.
  • On the field Field To Check select the option Body

Follow link with Regex test


Second option

Follow these steps to work:

  • Fill in the Reference field with the following PATH wallets[0].id
  • Fill the Regular Expression field with the following Regex (.+?)
  • Put the value 1 in the field Match No.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.