• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with random ids in jmeter

 
Ganeshkumar cheekati
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
sugan san
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use csvconfigelement and session handling mechanism.


Please visit the following URL:
http://www.technix.in/jmeter-problems-and-solutions/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic