aspose file tools*
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
JavaRanch » Java Forums » Engineering » Testing
Bookmark "problem with random ids in jmeter" Watch "problem with random ids in jmeter" New topic
Author

problem with random ids in jmeter

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
Hi
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";
try{
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;
}else
addActionError("Operation Failed");
}
catch(Exception e)
{
e.printStackTrace();
}

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:
http://www.technix.in/jmeter-problems-and-solutions/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with random ids in jmeter