SPONSORS:






View RSS Feed

Ronak

General Guidelines for using JUnit Request Sampler of JMeter

Rate this Entry
by , 06-21-2015 at 02:23 AM (227 Views)
General Guidelines for using JUnit Request Sampler of JMeter

If you use setUp and tearDown, make sure the methods are declared public. If you do not, the test may not run properly.

Here are some general guidelines for writing Junit tests so they work well with Jmeter. Since Jmeter runs multi-threaded, it is important to keep certain things in mind.

Write the setUp and tearDown methods so they are thread safe. This generally means avoid using static memebers.
Make the test methods discrete units of work and not long sequences of actions. By keeping the test method to a descrete operation, it makes it easier to combine test methods to create new test plans.
Avoid making test methods depend on each other. Since Jmeter allows arbitrary sequencing of test methods, the runtime behavior is different than the default Junit behavior.
If a test method is configurable, be careful about where the properties are stored. Reading the properties from the Jar file is recommended.
Each sampler creates an instance of the test class, so write your test so the setup happens in oneTimeSetUp and oneTimeTearDown.


Disclaimer: The article/post is posted with the purpose of sharing knowledge and information.
The article may contain references, extract or content from other informative sources.
Researched/Authored/Compiled by -
Ronak Shah
Practice Head - Software Testing (QA), CIGNEX Datamatics

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:12 AM.

Copyright BetaSoft Inc.