How to find the grouping dynamic values

15 views
Skip to first unread message

Bharathi g

unread,
Jul 23, 2021, 5:03:49 AM7/23/21
to gat...@googlegroups.com
Hi,
 

scenario1:
Expression in response is as below:

property:{"address":{municipalname=abc34,postalcode=3253}}&lender:{authorizedoffice:
[{emailid:a...@xyz.com,phnum:2534343}]},{"address":{municipalname=xyz344,postalcode=7687}}

I have to capture postal code of property and  lender, so I write like below:

property:{"address":{municipalname=(.*?),postalcode=(.*?}} and for lender 

how to capture only postalcode?

lender:{authorizedoffice:
[{emailid:(.*?),phnum:(.*?)}]},{"address":{municipalname=(.*?),postalcode=(.*?)}}

  how to capture only lender postalcode?  

Scenario2:
Expression in response is as below:

property:{"address"{}}&lender:{authorizedoffice:
[{emailid:a...@xyz.com,phnum:2534343}]},{"address":{municipalname=xyz344,postalcode=7687}}

I have captured the property postal code from the scenario1 but it is throwing error for scenario2, how to handle this? is there way to pass default values?


Please help mee.

Bharathi g

unread,
Jul 23, 2021, 7:09:54 AM7/23/21
to gat...@googlegroups.com
can you help me pleaseee

Stéphane LANDELLE

unread,
Jul 23, 2021, 7:49:49 AM7/23/21
to gat...@googlegroups.com
scenarios are virtual user workflow and correspond to different populations of users. Out of the box, the data you capture from scenario1 is not available for scenario2.
I recommend you read the documentation, go through the tutorials and the Gatling Academy.


--

Stéphane Landelle

Chief Technical Officer

   

slan...@gatling.io
gatling.io
   
facebook twitter linkedin 


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/CAFc0BffKn1SC51uDkvoG26RnwsqSUXsuVsX9d%2BZNu0gZZZ%3D0gw%40mail.gmail.com.

Bharathi g

unread,
Sep 20, 2021, 12:01:27 PM9/20/21
to gat...@googlegroups.com
Hi,
I have a respone body like below

abc=345&stausvalue=3&xyz=754&count=33
abc=867&stausvalue=3&xyz=237&count=34
abc=537&stausvalue=7&xyz=237&count=66

I have captured abc and count values for stausvalue=3 from above responsecode like below

check(regex(abc=(.*?)&stausvalue=3&xyz=(.*?)&count=(.*?)).find.saveAs(cor_cnt))


but confused how to substitue'${cor_cnt}' for abc & count?
shall I use like this for abc=${cor_cnt_g0}
and for count = ${cor_cnt_g2}


Stéphane LANDELLE

unread,
Sep 20, 2021, 12:06:12 PM9/20/21
to gat...@googlegroups.com

check("""regex(abc=(.*?)&stausvalue=3&xyz=(.*?)&count=(.*?)""")
  .ofType[(String, String, String)]
  .saveAs("whatever"))


then ${whatever._1}, ${whatever._2} and ${whatever._3}


--

Stéphane Landelle

Chief Technical Officer

   

slan...@gatling.io
gatling.io
   
facebook twitter linkedin 

--
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.
Reply all
Reply to author
Forward
0 new messages