美文网首页
jmeter中遇到的小问题

jmeter中遇到的小问题

作者: 好大一只鹏 | 来源:发表于2018-09-30 14:33 被阅读0次

1.json 提取
例1:数据格式:

"categoryCount":,
        "studentList":[
            {
                "userId":,
                "sessionUserTrackingId":,
                "fullName":"",
                "score":null,
                "percentScore":null,
                "statusId":1,
                "scoreOrder":1,
                "isLate":false,
                "isEmend":false,
                "emendQuestionCount":0,
                "emendCount":0,
                "intensifyEmendQuestionCount":0,
                "intensifyEmendCount":0,
                "emendStatus":"",
                "emendTypeCode":"NO_NEED",
                "completedOn":null,
                "endDate":"",
                "alreadyPay":false
            },
            {
                "userId":,
                "sessionUserTrackingId":,
                "fullName":"",
                "score":null,
                "percentScore":null,
                "statusId":1,
                "scoreOrder":2,
                "isLate":false,
                "isEmend":false,
                "emendQuestionCount":0,
                "emendCount":0,
                "intensifyEmendQuestionCount":0,
                "intensifyEmendCount":0,
                "emendStatus":"",
                "emendTypeCode":"NO_NEED",
                "completedOn":null,
                "endDate":"1538150340",
                "alreadyPay":false
            },

提取userId对应的sessionUserTrackingId的对应提取方式: $..[?(@.userId==123)].sessionUserTrackingId。
2.如果我们想要拿到某一个字段的部分数据的话可以使用:

contractId:"contract1234567"

如果我们提取1234567的话,使用正则表达式匹配:"contract:(.+?)"

相关文章

网友评论

      本文标题:jmeter中遇到的小问题

      本文链接:https://www.haomeiwen.com/subject/gzdwoftx.html