Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jmeter-如何使用RegEx从请求(而不是响应)中提取值_Jmeter - Fatal编程技术网

Jmeter-如何使用RegEx从请求(而不是响应)中提取值

Jmeter-如何使用RegEx从请求(而不是响应)中提取值,jmeter,Jmeter,我有如下JSON请求: { "type": "SIGNUP", "data": { "userAccountInfo": { "email": "ta0620050706@gmail.com", "password": "qweQwe123!" }, "userAddressInfo": { "country": "United States"

我有如下JSON请求:

{
    "type": "SIGNUP",
    "data": {
        "userAccountInfo": {
            "email": "ta0620050706@gmail.com",
            "password": "qweQwe123!"
        },
        "userAddressInfo": {
            "country": "United States"
        },
        "userPersonalInfo": {
            "firstName": "test",
            "lastName": "test"
        }
    }
}
如何提取ta0620050706@gmail.com从以下请求中,考虑到电子邮件的价值始终是dinamic

感谢您的帮助

如果您正在谈论sampler,并且上面的JSON位于Body Data选项卡中,如:

您可以通过添加并使用以下代码来提取电子邮件:

vars.put('email', new groovy.json.JsonSlurper().parseText(sampler.getArguments().getArgument(0).getValue()).data.userAccountInfo.email)
它将提取您正在查找的值并将其存储到${email}

更多信息: