jmeter 正则表达式获取urllink
jmeter Regular expression get url link
我从 jmeter5.3 收到响应消息。
{"header":{"sndDt":"2021-02-01 20:13:37","msgCd":"CPAS.911.110.01","trxTp":"file.trans","trxChnlTp":"08","srvProNo":"870058120000000161","mrchntNo":"870058120000000161","corrId":"7b8b0f5623e14e3f83bbd68b56d14262","oriCorrId":"CPAS0000000000000000000000013094","signMethod":"RSA","signNo":"CN=063@202010150917224561@merAliaEN@85810850/OU=Enterprises/OU=ncc/O=ncc@operation@ca/C=cn","reserved":"????"},"body":{"status":{"sysRtnCd":"00000000","sysRtnDesc":"系统处理成功","sysDtTm":"2021-02-01 20:13:37","bizRtnCd":"00000000","bizRtnDesc":"业务处理成功","bizDtTm":"2021-02-01 20:13:37"},"srvProNo":"870058120000000161","fileTransURL":"http://36.110.9.124:9066/godfs/group1/upload","scene":"cpas","verifCd":"098272"}}&sign=W8T4Aucq96Oi2K7v2o8e7VQJwdPriyLDd1CcmJnjP3P1n5A4KMDsQ54kfpmz8uahn9ROl85lbGxQ0g6aG4HgI+EQ7k3AOVTvf385KN/ycz5cB/+g82v6W8ES/1Kvbcvr4gCe+NhpUUoAYNuBoprxcz1xb3JU12GlHY6OFLxLDFJ5hLkSnu+7B4SDQqU9UyZR7dJGHPz1pnF4UQrfAP9FjdVlG4boOTdHZznNqm+sBFgRTEZLQuztde6mgOhqMmteL1oEBKRS2YKufpbv5TeK9Xuog4eoH4zP2It05Rg6UHEN366dzUryu/Kl7FBchiTl11O5Cxrm6FLlTI5+SCqcHg==
我用jmeter正则表达式获取“fileTransURL”:“http://36.110.9.124:9066/godfs/group1/upload”。我想得到这个 url:http://36.110.9.124:9066/godfs/group1/upload.I set Jmeter Regular expression: "fileTransURL":"(.+*)".
但是没有得到这个url.only得到“%7Burl%7D”。请帮助检查。谢谢!
[在此处输入图片描述][1]
[在此处输入图片描述][2]
如果您真的想要正则表达式,最好允许任意数量的可选空格,例如:
"fileTransURL"\s*:\s*"(.+?)"
有关详细信息,请参阅 Regular Expressions JMeter 用户手册章节。
但是您的回复似乎是JSON so it makes sense to consider going for JSON JMESPath Extractor:
body.fileTransURL
简单的选择是使用 JSON Extractor
JSON路径表达式:$..fileTransURL
(表示查找二级参数fileTransURL)
匹配号 1
(找到第一个匹配项)
我从 jmeter5.3 收到响应消息。
{"header":{"sndDt":"2021-02-01 20:13:37","msgCd":"CPAS.911.110.01","trxTp":"file.trans","trxChnlTp":"08","srvProNo":"870058120000000161","mrchntNo":"870058120000000161","corrId":"7b8b0f5623e14e3f83bbd68b56d14262","oriCorrId":"CPAS0000000000000000000000013094","signMethod":"RSA","signNo":"CN=063@202010150917224561@merAliaEN@85810850/OU=Enterprises/OU=ncc/O=ncc@operation@ca/C=cn","reserved":"????"},"body":{"status":{"sysRtnCd":"00000000","sysRtnDesc":"系统处理成功","sysDtTm":"2021-02-01 20:13:37","bizRtnCd":"00000000","bizRtnDesc":"业务处理成功","bizDtTm":"2021-02-01 20:13:37"},"srvProNo":"870058120000000161","fileTransURL":"http://36.110.9.124:9066/godfs/group1/upload","scene":"cpas","verifCd":"098272"}}&sign=W8T4Aucq96Oi2K7v2o8e7VQJwdPriyLDd1CcmJnjP3P1n5A4KMDsQ54kfpmz8uahn9ROl85lbGxQ0g6aG4HgI+EQ7k3AOVTvf385KN/ycz5cB/+g82v6W8ES/1Kvbcvr4gCe+NhpUUoAYNuBoprxcz1xb3JU12GlHY6OFLxLDFJ5hLkSnu+7B4SDQqU9UyZR7dJGHPz1pnF4UQrfAP9FjdVlG4boOTdHZznNqm+sBFgRTEZLQuztde6mgOhqMmteL1oEBKRS2YKufpbv5TeK9Xuog4eoH4zP2It05Rg6UHEN366dzUryu/Kl7FBchiTl11O5Cxrm6FLlTI5+SCqcHg==
我用jmeter正则表达式获取“fileTransURL”:“http://36.110.9.124:9066/godfs/group1/upload”。我想得到这个 url:http://36.110.9.124:9066/godfs/group1/upload.I set Jmeter Regular expression: "fileTransURL":"(.+*)".
但是没有得到这个url.only得到“%7Burl%7D”。请帮助检查。谢谢!
[在此处输入图片描述][1] [在此处输入图片描述][2]
如果您真的想要正则表达式,最好允许任意数量的可选空格,例如:
"fileTransURL"\s*:\s*"(.+?)"
有关详细信息,请参阅 Regular Expressions JMeter 用户手册章节。
但是您的回复似乎是JSON so it makes sense to consider going for JSON JMESPath Extractor:
body.fileTransURL
简单的选择是使用 JSON Extractor
JSON路径表达式:$..fileTransURL
(表示查找二级参数fileTransURL)
匹配号 1
(找到第一个匹配项)