Skip to main content

Run jmeter from eclipse

Download jmeter source and binaries: http://archive.apache.org/dist/jakarta/jmeter/binaries/jakarta-jmeter-2.3.4.zip http://archive.apache.org/dist/jakarta/jmeter/source/jakarta-jmeter-2.3.4_src.zip

Unpack jmeter source file, and rename eclipse.classpath into .classpath. Add a .project file to the same directory:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
  <name>jakarta-jmeter-2.3.4</name>
  <comment></comment>
  <projects>
  </projects>
  <buildSpec>
    <buildCommand>
      <name>org.eclipse.jdt.core.javabuilder</name>
      <arguments>
      </arguments>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
  </natures>
</projectDescription>
Now import the source code as eclipse project.

Add all libs of binary distribution (lib/*.jar) to the new project's lib dir.
Add all files, except ApacheJmeter.jar (bin/**/*) to the new project's bin dir.


Clean eclipse project.
Run ant package on the build.xml file to create the RMI jars.


Create a launcher for org.apache.jmeter.NewDriver and set arguments/working directory to: ${workspace_loc:jakarta-jmeter-2.3.4/bin}.
When you start the launcher, jmeter comes up.

With the same configuration you can also debug. Add a debug breakpoint to for instance: org.apache.jmeter.engine.StandardJMeterEngine.runTest()
Start your debug session now, and run example script. It will wait when you start a test run.

To debug your own project (with sampler for instance):
  • make your own project dependent on jakarta-jmeter project
  • check that all jars from jakarta-jmeter project are exported
  • duplicate the launcher of above, but replace project by your own now
  • make sure your working directory is still pointing to jakarta-jmeter project's bin directory
  • check that your own src directory of sampler is on the classpath of the launcher
  • launch jmeter with this project's launcher
  • add debug breakpoints to sampler's code

Comments

Unknown said…
Thank you very much for your post, you've been a great help
Unknown said…
This comment has been removed by the author.
Unknown said…
thank you!

Popular posts from this blog

SSL handshake failed: Secure connection truncated

Got this problem on Ubuntu 9.10 and 10.10. svn co --username=xx https:/yy zz “SSL handshake failed: Secure connection truncated” According to this link bug-ubuntu The solution is: sudo apt-get install libneon27 cd /usr/lib/ sudo rm libneon-gnutls.so.27 sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27

Junit4 running parallel junit classes

To run junit testcases parallel, you can create your own class to run junit with: Add this tag to your class declaration. @RunWith(Parallelized.class) Implementation of this class looks like: package mypackage; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.junit.runners.Parameterized; import org.junit.runners.model.RunnerScheduler; public class Parallelized extends Parameterized {         private static class ThreadPoolScheduler implements RunnerScheduler     {         private ExecutorService executor;                 public ThreadPoolScheduler()         {             String threads = System.getProperty("junit.parallel.threads", "16");    ...

Create a groovy console and bind to selenium

Required groovy files In the previous posting we defined the pom file that we need for our build environment. Now we will setup some groovy files to get selenium and groovy running interactively. ConsoleWaiter.groovy The idea of Groovy Console I found on some other sides. Honour goes for instance too: http://josefbetancourt.wordpress.com/tag/eclipse-2/ I copied some code of this, and put it under src/test/groovy/com/jankester/selenium/test/utils: package com.jankester.selenium.test.utils /** * File: ConsoleWaiter.groovy */ import groovy.lang.Binding; import groovy.ui.Console; /** * Provides a wrapper for the console. * * Based on source by John Green * Adapted from: http://www.oehive.org/files/ConsoleWaiter.groovy * Released under the Eclipse Public License * http://www.eclipse.org/legal/epl-v10.html * * I added methods to allow use from Java. * * The run() method launches the console and causes this thread * to sleep until the console's window is closed....