Can't check an array with JSONPath Assertion. Update JSONPath to 2.1?

1,719 views
Skip to first unread message

Damien Davis

unread,
Jan 18, 2016, 12:15:07 PM1/18/16
to jmeter-plugins
Hi,
I'm having an issue with asserting nested arrays.

Ex:
{"rows":[{"name":[1]},{"name":[2]},{"name":[3]}],"columns":[{"name":["SAVEA"]},{"name":["CHOPS"]},{"name":["ERNSH"]},{"name":["BERGS"]},{"name":["LINOD"]}],"cells":[{"name":"sum-FREIGHT","dType":"Float"}],"data":[[[0],[0],[412],[9],[63]],[[0],[23],[858],[93],[3]],[[368],[92],[74],[13],[59]]]}




And I keep getting this response:



Can someone tell me what I'm doing wrong?  


I was thinking that if I could upgrade the jayway/Jsonpath jar, that might handle this and another issue I was having with nested array's 

https://github.com/jayway/JsonPath/issues/79


Is there a way for me to upgrade the jar manually or will I have to wait for a total package update?


Thanks,

Damien

and...@blazemeter.com

unread,
Jan 18, 2016, 5:47:04 PM1/18/16
to jmeter-plugins
Hi,

Please check out latest developer snapshots, it's jsonpath 2.0.0 in it. It might help. http://jmeter-plugins.org/downloads/all/#Developer-Snapshots

--
Andrey

Damien Davis

unread,
Jan 19, 2016, 4:55:29 PM1/19/16
to jmeter-...@googlegroups.com
Thanks for the update.

--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/MUQ0SnPqDy4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dqua...@gmail.com

unread,
Jan 13, 2017, 6:21:15 AM1/13/17
to jmeter-plugins
 I am using JSONPath Assertion version 2.5, but this issue is still occur with the same steps.
Please help me.
Vào 04:55:29 UTC+7 Thứ Tư, ngày 20 tháng 1 năm 2016, Damien Davis đã viết:

Damien Davis

unread,
Jan 13, 2017, 12:07:11 PM1/13/17
to jmeter-...@googlegroups.com
Check your response file using http://www.jsoneditoronline.org/
Inline image 1

If you don't need to validate the entire array, you can validate one of the specific values using $.data[0][1].startval = 1 (per my example)

Or $.data[0][2] = 412 in my original example.  

Try a more specific target and let me know if that helps.

To unsubscribe from this group and all its topics, send an email to jmeter-plugins+unsubscribe@googlegroups.com.
Message has been deleted

dqua...@gmail.com

unread,
Jan 13, 2017, 11:19:37 PM1/13/17
to jmeter-plugins
Thank for your reply.
I tried your way to validate one of the specific values. 
It is very helpful.
It worked well with one expected value.

But in my situation, they want me to verify an array from JSON path in only 1 JSON Assertion.
This is my situation, the JSON response:
{
 "code":200,
 "contact":{
   "id":28071,
   "description":"test description",
   "info":{
       "ngn_number":[
           "2003",
           "2004"
       ]
   }
 }
}

- My JSON Path Assertion: 
    + JSON Path: $.contact.info.ngn_number
    + Expected value: ["2003","2004"]























- But the result is:







 I don't know that is any mistake from my actions?
Help me, please.

- I tried to verify the array in JSON Path another way follow the link: http://stackoverflow.com/questions/35555720/jmeter-can-json-path-assertion-plugin-match-to-an-array
But we have to use many steps.
Hope to receive your reply.

Regards,

Andrey Pokhilko

unread,
Jan 14, 2017, 2:11:19 AM1/14/17
to jmeter-...@googlegroups.com

Hi,

I confirm the issue. I will fix it and let you know once the fix is available.

Andrey Pokhilko

--
You received this message because you are subscribed to the Google Groups "jmeter-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.

Andrey Pokhilko

unread,
Jan 14, 2017, 8:44:01 AM1/14/17
to jmeter-...@googlegroups.com

I have released version 2.6, please use it. Make note that you have to uncheck "regexp" mode to use it the way you want.

Andrey Pokhilko

dqua...@gmail.com

unread,
Jan 15, 2017, 1:39:27 AM1/15/17
to jmeter-plugins
Hi,

Thank you for the fix and release.
I checked it in newest version 2.6, it works well in my situation with unchecking "regexp" mode.
Hope to make this plugin better together.

Best reagards,

Vào 20:44:01 UTC+7 Thứ Bảy, ngày 14 tháng 1 năm 2017, Andrey Pokhilko đã viết:

Damien Davis

unread,
Jan 17, 2017, 2:09:26 PM1/17/17
to jmeter-...@googlegroups.com
Thanks a lot Andrey. Is it included in the latest jmeter-plugins library or do I need to do a separate download and merge?

Thanks again,
Damien

--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/MUQ0SnPqDy4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugins+unsubscribe@googlegroups.com.

Andrey Pokhilko

unread,
Jan 17, 2017, 2:35:30 PM1/17/17
to jmeter-...@googlegroups.com

Hi,

It is available with Plugins Manager. I don't understand what you mean by "latest jmeter-plugins library", sorry

Andrey Pokhilko

Damien Davis

unread,
Jan 18, 2017, 11:23:54 AM1/18/17
to jmeter-...@googlegroups.com
same thing...thanks

To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugins+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages