You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Lionel Blanco <ml...@gmail.com> on 2021/11/16 17:40:42 UTC

Extract first Value from list

Hi everyone.

I need to extract a value from a list.
I need to extract the first value from the groups field, I mean " 908520"
How can I do this?


"play": "1",
                    "timeshift": "",
                    "purchaseid": "775573641",
                    "name": "CV_MENSUAL",
                    "offerid": "14328519",
                   * "groups":* "908520,889224,889137",
                    "npvrstorage": "",
                    "payway_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9



Lionel Blanco | *Tester QA Automation*

*Celular:* +5491160132136
*Email   :* mlionelblanco@gmail.com
*LinkedIn: blancoml <https://www.linkedin.com/in/blancoml/>*

Re: Extract first Value from list

Posted by Dmitri T <gl...@live.com>.
 1. Add a Regular Expression Extractor
    <https://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor>as
    a child of the request
    <https://www.blazemeter.com/blog/jmeter-scoping-rules-the-ultimate-guide/>
    which returns the above response
 2. Configure it as follows:
      * Name of created variable: anything meaningful, i.e. *group*
      * Regular Expression: *groups"\s*:\s*"(\d+)*
      * Template:*$1$*
 3. That's it, you will be able to refer the extracted value as
    *${group}* <https://jmeter.apache.org/usermanual/functions.html>
    later on where required.

*
*
On 11/16/2021 6:40 PM, Lionel Blanco wrote:
> Hi everyone.
>
> I need to extract a value from a list.
> I need to extract the first value from the groups field, I mean " 908520"
> How can I do this?
>
>
> "play": "1",
>                      "timeshift": "",
>                      "purchaseid": "775573641",
>                      "name": "CV_MENSUAL",
>                      "offerid": "14328519",
>                     * "groups":* "908520,889224,889137",
>                      "npvrstorage": "",
>                      "payway_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
>
>
>
> Lionel Blanco | *Tester QA Automation*
>
> *Celular:* +5491160132136
> *Email   :*mlionelblanco@gmail.com
> *LinkedIn: blancoml<https://www.linkedin.com/in/blancoml/>*
>