jsonpath and regex

288 views
Skip to first unread message

morten bjoernsvik

unread,
Apr 19, 2016, 10:02:26 AM4/19/16
to Gatling User Group
Hi all

I need to verify that some keys in the json response are not empty and save them

//This is how we do it today:
.check(regex(""""number":"(\S{8})"""").saveAs("myPhoneNumber"))

//how can I get regex to apply to jsonPath output because we may have many different numbers
//(poor design but outside my control)
.check(jsonPath("$..customers[0].number").regexp(""""(\S+)"""").saveAs("myPhoneNumber"))


Thanks
--
Morten Bjoernsvik, Oslo, Norway



Stéphane LANDELLE

unread,
May 9, 2016, 11:58:41 AM5/9/16
to gat...@googlegroups.com
Use a transform step in your check.

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages