Thursday, October 6, 2016

How to deal with jmeter scripts with huge post body

    Jmeter is one of the best open source resource for testing.Many of the testers will be familiar with jmeter.   In this blog I will explain how to deal with jmeter scripts with massive post body which may effect the performance of the jmeter.    

     First of all while recording itself make note of HTTP sampler names in which post body is huge so that it may be reference for you during editing.Now after recording just save the file in your desired location.Now disable the transaction which are having huge post body and run the .jmx file.Now according to that post body apply the correlations to extract data to be replaced in post body.Note down the variable names.

     Now open this saved .jmx file in notepad(better if it is notepad++). Now search with the sampler name along with sampler number which you have noted during scripting.There you can see the post body inside string elements with " replaced by " as it encodes the value so don't get confused.Now copy that post body and paste it in another notepad page.Now here do the modification like replacing with correlated values and copy that modified post body and replace the same in the main file.
     But be careful not to change the format of the .jmx string element because it may show you an error, eventually jmeter will not open it.