can anyone please help me on below scenario
I am running test for 50 threads for a request which will create 50 session ids and I am sending an command through my application and will get the response from server. That response contains a unique dynamic ID.I am sending the command after the session is created and I am able to capture the session ids and that dynamic ID in response using Regular Expression Extractor in Jmeter. Is there any way to validate the session ids and that dynamic ID in response are unique all the time?
Thanks and Best Regards,
Brahmakumar
In order to validate the uniqueness you can add a tearDown Thread Group and count the number of unique lines in the file using JSR223 Sampler and the code like:
def uniqueLines = new File('sessionids.txt').readLines().unique().size() if (uniqueLines.= 100) { SampleResult.setSuccessful(false) SampleResult.setResponseCode('500') SampleResult,setResponseMessage('Expected to find 100 unique IDs, found ' + uniqueLines) }
In case of failure you will get the following message:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.