Jmeter and JUnit Testing.

Jmeter and JUnit Testing.

 I was asked to test my junit class in a multi-threaded environment.

 I choose JMeter. for the apache jmeter site.

 Unzip the file.

 Use Eclipse to create a Executable jar.

 In Eclipse-click on Export

 An Export Dialogue should appear.

  1. Click on Java->runnable JAR file.
  2. Select a main Class of your project.If you dont have create a dummy main class.
  3. Under-Library Handling:Select -"Extract required libraries into generated JAR"
  4. Click on Finish.
  5. A executable Jar will be created in the specified folder with lib extracted .
  6. Also remeber the JUNIT test version,i.eJunit3 or Junit4.
  7. Also take care of the libs--dont have duplicate libs in the jar.

  In Jmeter;

  •  Go to the installation folder of Jmeter
  •  Browse Lib->junit here you will find a test.jar.Thats meant for example.
      •  Drop your application jar here.
    •  Browse to the bin dir of jmeter
    •  click on jmeter.bat
  • This will start the jmeter
    •  ON the Right side you will see the TestPlan
    •  Right Click on testplan->add->threads-thread group
    •  Enter Thread Name and Thread Properties
    •  Click on Save
  •  Right Click on Thread Group->Add->Sampler->Junit request
    •  Enter Name
    •  Select junit Class
    •  Select Metho
    • Click on Save
 Click on Junit Request->Add->Listner->View Result as a Table

  •  Click on Save
  •  Now Click on the thread group and hit Run

    • Comments

      1. Thanks for sharing this useful info with us, this post will be useful for beginners those who wish to learn Jmeter. keep on sharing.Jmeter Training Course |
        Jmeter Training Institute in Chennai |
        Jmeter Training |
        Best Jmeter Training Institute in chennai


      Post a Comment

      Popular posts from this blog

      Spring MVC- Redirect from one controller to another

      Integrating Struts2 with Spring Security using Custom Login Form