• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with random ids in jmeter

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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/
reply
    Bookmark Topic Watch Topic
  • New Topic