Micheal
Micheal

Reputation: 21

How to retrieve the dynamic value from the JMeter

{"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":"(.*?)"

Upvotes: 2

Views: 26

Answers (2)

Ivan G
Ivan G

Reputation: 2707

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

enter image description here

it will save GetFormSessionSurfaceJsonResult attribute value into a JMeter Variable.

And second like this:

enter image description here

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

Upvotes: 1

sunny_teo
sunny_teo

Reputation: 1999

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

Regexpression

Upvotes: -1

Related Questions