It is possible via some scripting.
For example, if you have the following JSON payload:
{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]}
And the following JSONPath Expression:
$.employees..firstName
which returns first names as follows:
["John","Anna","Peter"]
You can get matches number by counting commas in the resulting variable.
Given that you're using "name" as the Variable Name in JSON Path Extractor
- Add the a Beanshell PostProcessor below JSONPath extractor
Put the following code into the PostProcessor's "Script" area:
int matches = vars.get("name").split(",").length;
vars.put("matches",String.valueOf(matches));
- Optionally add a Debug Sampler and a View Results Tree Listener and run your test
You should have "matches" variable containing "3"
For more information on Beanshell scripting in Apache JMeter see How to use BeanShell: JMeter's favorite built-in component guide.