Leandro Guelerman
Leandro Guelerman

Reputation: 33

Karate - get all specific field values from a response

On karate 0.6.0, the following code returned an array with all the ids:

now on version 0.9.0 the same returns the following error:

wishlist[*].product_info.id, :1:9 Expected an operand but found *

Can someone tell me what change?

Thanks!

Upvotes: 1

Views: 2318

Answers (1)

Alex D
Alex D

Reputation: 410

You must use the get keyword to save the results of a JsonPath expression as described in the docs.

* def ids = get wishlist[*].product_info.id

Upvotes: 2

Related Questions