The __time function accept a variable name that you can pass in to save the value generated at that time into a JMeter variable( https://jmeter.apache.org/usermanual/functions.html#__time ) . ${__threadNum}${__time(ddMMyyyyHHmmssSSS,yourVariableName)} Then in your DB Query you can just pass that as the variable on which you are querying ${yourVariableName} - In general anything that you are passing in the request can always be saved for use later
regards deepak On Fri, Oct 11, 2019 at 10:15 AM Mantanz <[email protected]> wrote: > Hi All, > > Jmeter Version: 5.0 > > I have a scenario where we fire custom json onto application. The > application only responds as success or failure. This is followed by > checking the fire event id in a specific table in database. So I need to > connect to DB and then check the event id value sent in request. > The problem here is that the response is not having the event id which was > sent for the request thus I couldn’t find a way. Is there a way I can check > the request event id field and fire a DB query based on that. > > > For load testing each event is maintained as unique using the function; > ${__threadNum}${__time(ddMMyyyyHHmmssSSS)} > > > Request : > {"event_id":"${__threadNum}${__time(ddMMyyyyHHmmssSSS)}","EventSubType":"SUBEVENT","event-name":"TEST > EVENT","EventType":"Sample type","source":"fin","msgBody":"Body text"} > > Response : Success > > DB Query : select count(1) from events where > event_id=${__threadNum}${__time(ddMMyyyyHHmmssSSS)} > > Expected Response: If the count is 1 then “Test Case Successful” else > “Test Case failed”. > > Kindly help. > > Let me know in case of any more information. > > Warm Regards, > Manish Taneja
