It's not a secret anymore!
The moose likes Testing and the fly likes problem with random ids in jmeter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "problem with random ids in jmeter" Watch "problem with random ids in jmeter" New topic

problem with random ids in jmeter

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
i am generating random id for each request in my action class as follows in first method.

sUUID = String.valueOf(UUID.randomUUID()+"_"+request.getSession().getId());
request.getSession().setAttribute("UUID", sUUID);
sUUID = GenerateUUID.getMDF(sUUID);

and in other method which i need to execute using jmeter.

public String saveModelID()
String rResult = "input";
XSVCInt oXSVCInt = oSVC.getXSVCInt();
String sessionUUID = (String)request.getSession().getAttribute("UUID");
sessionUUID = GenerateUUID.getMDF(sessionUUID);
if (sUUID.equals(sessionUUID)){
rResult = oXSVCInt.savePartModelID(sPartNumber, sModelParam);
sModelSelect = null;
addActionError("Operation Failed");
catch(Exception e)

return rResult;

i have provided action in http request in jmeter and i need to provide input values so if i provide sUUID value then sessionUUID is generating other value(not equal) which results operation failed.
if i will not provide sUUID value then its null so getting nullpointerexecption.

how can i handle these kind of things in jmeter?

can anyone help me?

SCJP5 and SCWCD1.5
Think Twice Act Wise...
sugan san
Ranch Hand

Joined: May 23, 2013
Posts: 47
You should use csvconfigelement and session handling mechanism.

Please visit the following URL:
I agree. Here's the link:
subject: problem with random ids in jmeter
It's not a secret anymore!