Correlation using regex | Java Gatling

Hi I am getting error – Failed to build request: **No attribute name **
d ‘ID’ is defined.
I am using simple regex chcek and saving it in a variable as below:

.check(regex(“[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{9}…(?=)”)
.findAll().saveAs(“ID”))

I am not defining it anywhere , Can someone help me, I am using JAVA to create Gatling scripts

I am not defining it anywhere

Yes you are, I guarantee. Please double check for things like #{ID}, ${ID} (deprecated syntax) or session.getString("ID").

Can you please send me the syntax to define it
.exec(session → {
session.getString(“#ReservationID”);
return session;
})
I tried this ,but not working

Please have a look at the documentation:

You’re mixing/confusing them and that can’t work.

Please modify as this one and test again if it helps you

.exec( session -> {
     val name = session.set("ReservationID", "your expecting value");
name
})

to use it somewhere else in Gatling session, call:

.exec(
    yourhttp( #{ReservationID} )
)

If you are insisting on getString rather than set, then I may misunderstand your use case tho

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.