You can try: https://stackoverflow.com/questions/30412717/groovy-script-in-jmeter
Deepak "The greatness of a nation can be judged by the way its animals are treated - Mahatma Gandhi" +91 73500 12833 deic...@gmail.com LinkedIn: www.linkedin.com/in/deicool "Plant a Tree, Go Green" Make In India : http://www.makeinindia.com/home On Thu, Oct 3, 2024 at 12:42 PM Nick Danielsson <nick.daniels...@pensionsmyndigheten.se.invalid> wrote: > Hello! > > I have a problem getting jmeter to start a javaclass when I have the Java > Request inside an If-Controller. > > The testplan consists of several Thread Groups, each responsible for > starting a java class with the help of a Java Request. > This testplan has been run several times with no similar problems. > > I have now modified it a bit so that each Thread group has it’s own > variable with an If-Controller to see if it should run the Java Request or > not. > > > > The first errors I got was: > > Uncaught Exception java.lang.ExceptionInInitializerError in thread > Thread[#36,Kuverthandlaggning 3-1,5,main]. See log file for details. > > Uncaught Exception java.lang.NoClassDefFoundError: Could not initialize > class org.codehaus.groovy.runtime.InvokerHelper in thread > Thread[#37,Kuverthandlaggning 3-2,5,main]. See log file for details. > > I then tried tried to delete the If-Controller and the Java Request as > they were copied, (we have encountered problems with copied stuff before) > remade new ones, I then instead got the error message: > Uncaught Exception java.lang.StackOverflowError in thread > Thread[#36,Kuverthandlaggning 3-1,5,main]. See log file for details. > > > I then tried to change to number of threads to 1 and to only do 1 loop > count in the Thread Group I was testing with. > With this change, I no longer get any error messages in the console but > the test never starts. I test it by debuging in Intellij. > > However, if I move the Java Request out of the If-Controller, and have it > directly under the Thread group like we used to have before the changes, > everything works fine. > How come when I add an If-Controller to the equation everything breaks > down? > > > This *doesn’t work*: > > > This works: > > > I have double checked with logging that I actually get inside the > If-Controller when the expression is true, so I can confirm that that is > not the problem. > > Have anyone else had any experience of this or do you have any clues on > why it’s not working? > > Kind regards Nick > > > > Vill du veta hur Pensionsmyndigheten hanterar dina personuppgifter? Se > myndighetens webbplats > <https://www.pensionsmyndigheten.se/om-pensionsmyndigheten/allmanna-handlingar/om-personuppgifter> > . >