Search key in body and tranform it

Hi i try to test a moolde quinz, so i have correctly login but when create a attempt quiz i must transmit sesskey. This key is not in session but in body.

i try this

exec(http(“Go to quiz”)



.check(regex(""“sesskey=\w*”"").find(0) #### This find correctly sesskey but in this format sesskey=jhsfdkjbsdkjf





.pause(7, 8)


with check i find correctly sessly and save it but in this format “sesskey=jhsfdkjbsdkjf”

I want split it and save only value but transform in not documentation so i want a suggesiton

Can you help Me?

You have to use a capture group. See javadoc:

You probably want something like sesskey=(\w*)

Note that you don’t need find(0) as it’s the default.

I try solution with this :smiley:


.transform(string =>{_.split("=")(1)})


Thank to me :smiley:

Still, using a capture group would be much cleaner…