JMeter: How to use Regular Expression to extract the value of a duplicate field?

后端 未结 7 709
名媛妹妹
名媛妹妹 2021-01-17 02:35

I have the following Response Body JSON:

{
    \"address\": [
    {
        \"id\": \"1234\"
    }
    ],
    \"id\": \"d1a4f010-48d9-434b-9b3a-2d2b12f5e38c\         


        
7条回答
  •  孤街浪徒
    2021-01-17 03:22

    The given response values

    {
        "address": [
        {
            "id": "1234"
        }
        ],
        "id": "d1a4f010-48d9-434b-9b3a-2d2b12f5e38c"
    }
    

    Regular Expression to extract the second id values

    Regular Expression formats

    ],\s\s\s\s\s"id": "(.+)"
    

    Note

    The above regex extract the following id values
    d1a4f010-48d9-434b-9b3a-2d2b12f5e38c
    

提交回复
热议问题