Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

I need help JSON Extractor and BeanShell Assertion to capture an ID in Response

18 views
Skip to first unread message

Quynh Ly

unread,
Mar 20, 2022, 1:05:08 PM3/20/22
to BlazeMeter Forum
Hello SMEs,

I am using the JSON Extractor and BeanShell Assertion to get the ID highlighted below but I am unable to do that.  Kindly review and advise what need to be done

The highlighted ID that I need to capture is in the Response.

ID.PNG
The JSON and BeanShell that I use
JSON.PNG
Beanshell.PNG
The result I get

Result.PNG

Dmitri T

unread,
Mar 21, 2022, 4:15:42 AM3/21/22
to BlazeMeter Forum
I believe correct JSONPathexpression would be $..id

Also since JMeter 3.1 you shouldn't be using Beanshell, consider switching to JSR223 Assertion and the code like:

props.put('PickWaveWorkOrder', vars.get('PickWaveWorkOrder'))

Quynh Ly

unread,
Mar 22, 2022, 2:26:06 AM3/22/22
to BlazeMeter Forum
I appreciate very much your great help and advice  Dmitri T .  It works great!!!
Reply all
Reply to author
Forward
0 new messages