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

后端 未结 7 771
名媛妹妹
名媛妹妹 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:10

    I don't know jmeter but to get the value of second id this expression

     "id"\s*:.+?"id"\s*:\s*"([^"]*)" 
    

    It will return what you want on the $1 variable in a some languages. I suppose in jmeter you can have something similar to this in order to get the first group.

    Maybe ${MYREF_g1} according this page ?

提交回复
热议问题