performance testing - How to retrieve the dynamic value from the JMeter - Stack Overflow

admin2025-04-30  0

{"GetFormSessionSurfaceJsonResult": "{\"$type\":\"DecisionsFramework.Design.Form.FormSessionInfo, DecisionsFramework\",\"useCompositeControls\":false,\"documents\":[{\"$type\":\"DecisionsFramework.Design.Form.CssDocumentInfo, DecisionsFramework\",\"documentName\":\" Default Style\",\"modifiedDate\":\"2024-11-18T15:21:51.944124\"},{\"$type\":\"DecisionsFramework.Design.Form.CssDocumentInfo, DecisionsFramework\",\"documentName\":\"DF\",\"modifiedDate\":\"2024-11-17T11:16:33.643953\"},{\"$type\":\"DecisionsFramework.Design.Form.CssDocumentInfo, DecisionsFramework\",\"documentName\":\"HideFolderTimeLineFeatures\",\"modifiedDate\":\"2024-11-19T10:35:00.18753\"}],\"initialControlsData\":[{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"01J6RT969T5RKZDS9BJSQSY520\",\"OutputValue\":[{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"01JFCBQQX04SQ1GGPDNDM5CTRH\",\"OutputValue\":\"I am the owner of a registered vessel or I have authorization to declare a vessel of another owner (attach the authorization in document upload tab)\"},{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, [{\"$type\":\"DecisionsFramework.Design.Form.ComponentData.CompositeControls.RuntimeChildrenProviderChildClientInfo, DecisionsFramework\",\"Id\":\"01JFCBQR03NPF4KQF4CY0TVCB2\",\"ClientData\":[{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"Postal Codes\",\"OutputValue\":\"\"},viceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"Flat\",\"OutputValue\":\"\"}]}]},

From this response i need to get the dynamic value for**"Id":"01JFCBQR03NPF4KQF4CY0TVCB2"** and pass for the another request.

i have used json and regular expression extractor but both of it haven't fetched the corresponding value.

json path is retrieved the whole content and regular expression haven't retrieved the value.

Used in regular expression "Id":"(.*?)"

{"GetFormSessionSurfaceJsonResult": "{\"$type\":\"DecisionsFramework.Design.Form.FormSessionInfo, DecisionsFramework\",\"useCompositeControls\":false,\"documents\":[{\"$type\":\"DecisionsFramework.Design.Form.CssDocumentInfo, DecisionsFramework\",\"documentName\":\" Default Style\",\"modifiedDate\":\"2024-11-18T15:21:51.944124\"},{\"$type\":\"DecisionsFramework.Design.Form.CssDocumentInfo, DecisionsFramework\",\"documentName\":\"DF\",\"modifiedDate\":\"2024-11-17T11:16:33.643953\"},{\"$type\":\"DecisionsFramework.Design.Form.CssDocumentInfo, DecisionsFramework\",\"documentName\":\"HideFolderTimeLineFeatures\",\"modifiedDate\":\"2024-11-19T10:35:00.18753\"}],\"initialControlsData\":[{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"01J6RT969T5RKZDS9BJSQSY520\",\"OutputValue\":[{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"01JFCBQQX04SQ1GGPDNDM5CTRH\",\"OutputValue\":\"I am the owner of a registered vessel or I have authorization to declare a vessel of another owner (attach the authorization in document upload tab)\"},{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, [{\"$type\":\"DecisionsFramework.Design.Form.ComponentData.CompositeControls.RuntimeChildrenProviderChildClientInfo, DecisionsFramework\",\"Id\":\"01JFCBQR03NPF4KQF4CY0TVCB2\",\"ClientData\":[{\"$type\":\"DecisionsFramework.ServiceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"Postal Codes\",\"OutputValue\":\"\"},viceLayer.Services.ContextData.DataPair, DecisionsFramework\",\"Name\":\"Flat\",\"OutputValue\":\"\"}]}]},

From this response i need to get the dynamic value for**"Id":"01JFCBQR03NPF4KQF4CY0TVCB2"** and pass for the another request.

i have used json and regular expression extractor but both of it haven't fetched the corresponding value.

json path is retrieved the whole content and regular expression haven't retrieved the value.

Used in regular expression "Id":"(.*?)"

Share Improve this question asked Jan 5 at 1:01 MichealMicheal 211 silver badge4 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

You can use 2 JSON Extractors for this, one configured like this:

it will save GetFormSessionSurfaceJsonResult attribute value into a JMeter Variable.

And second like this:

I cannot come up with a proper JSONPath expression because your response is incomplete and/or malformed. See JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios article for more details

Use regex like shown in below snapshot...extra forward slash wherever it is single slash.

转载请注明原文地址:http://anycun.com/QandA/1746022573a91470.html