How do i pass ## separated values ?

Hi All,

How do i pass following ## separated values in the post method request…???

For Example - [“123##456”,“789##101112”,“131415##161718”,“192021##222324”]

Guys – will you please help me?

Thanks & Regards,

Rushabh

What are you actually trying to do?

Consider the following scenario:

For Example - [“123##456”,“789##101112”,“131415##161718”,“192021##222324”]

first-id:123

second-id:456

Above mentioned ids are i am getting from response and saving the value from previous request

saving the values via this method .check(jsonPath("$.data[*].Id").findAll.saveAs(“Id”)) which is working perfectly fine for me.

But now i need to pass the above mentioned ids in next request of post method which comes as

[“123##456”,“789##101112”,“131****415##161718”,“192021##222324”]

So how to achieve that? If you could explain with an example please?

Thanks,

Rushabh

Guys - any luck ???

It’s still not clear what you are trying to do.

Say you have an array of Ints. Write code to translate that array of Ints into a string in the necessary format. Once you figure out how to do that, then if you still aren’t sure what to do, then give a better explanation of the problem.

I suspect that you originally have 2 different sets of ids in your JSON payload.
If so, I would personally save them separately, and then “zip” the 2 Seqs to I get a Seq of Tuple2.
Otherwise, you can use “grouped(2)” with your way.

Then, you have to use “mkString” to concatenate.

Check how to execute a Scala function with Gatling to edit the “Session”, and check some Scala tutorial.

Thanks for you reply. I will work on this which you have suggested and get back to you.

Rushabh