1

I am currently working in a insurance creation application. I have been facing a challenge in Capturing the Transaction ID. Below is a recording for example, Sample Start:2022-01-05 19:42:39 IST {"clientTransactionId":"2022010519423991400003554512008008822698"} Sample Start:2022-01-05 19:37:10 IST {"applicationTransactionId":"220105193709901533"}

The above recording shows the clientTransactionId and applicationTransactionId having the first 14 digits as timestamp and the rest as random numbers. I am looking for a function to capture these transaction IDs as I have never faced such challenge before (Combination of Timestamp and Random numbers). Please help.

Sri Ganesh
  • 37
  • 1
  • 6

1 Answers1

2

Just add JSON JMESPath Extractor as a child of the request which returns the above response and configure it like:

  • Names of created variables: anything meaningful, i.e. clientTransactionId
  • JMESPath Expressions: clientTransactionId
  • Match No: 1

enter image description here

Once done you will be able to refer extracted value as ${clientTransactionId} JMeter Variable where required

enter image description here

applicationTransactionId can be handled in exactly the same manner

More information:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks for your answer. But the problem here is, the above mentioned TransactionIds are getting passed only on the request. Those Ids are not present in the response. Please let me know on what to do in this case – Sri Ganesh Jan 30 '22 at 13:48
  • 1
    It this case you can generate the timestamp using [__time() function](https://jmeter.apache.org/usermanual/functions.html#__time) and the remainder using [__RandomString() function](https://jmeter.apache.org/usermanual/functions.html#__RandomString), something like `${__time(yyyyMMddhhmmss,)}${__RandomString(26,0123456789,)}` . More information on JMeter Functions concept: [https://www.blazemeter.com/blog/apache-jmeter-functions-introduction](https://www.blazemeter.com/blog/apache-jmeter-functions-introduction) – Dmitri T Jan 30 '22 at 13:59