Monday, July 8, 2013

Jmeter Dynamic value Storing to a File using jp@gc - Flexible File Writer

Scenario:
I am taking the one of the scenario to demonstrate this .I am testing my blog here (http://mcheepati.blogspot.com/p/loading-toc.html). We can do the following thing
 1. From this blog i need to extract the PostID, then it has to write to a file.
 2. I need the application URL as well PostID into a file. (Here if you need you can save your User Name,
            Password and your dynamic value to a file with the help of this)

Please install the http://code.google.com/p/jmeter-plugins/ jmeter plugins to do this

Please see the Steps below:
Step 1: Add the "Thread group" to "Test Plan"
Step 2: Add the "User Defined Variables" config element from the "Config Element"
                 Here add the URL to this,  as shown below



Step 3: Add "HTTP sampler" to the "Thread group". Then enter the Server Name or IP as ${url} and path as /p/loading-toc.html. Please see below




Step 4: Add the "jp@gc - Dummy Sampler" from "Samplers". Then enter the "Request Data" and "Response Data"

In "Request Data", don't include the Dynamic values.
In "response Data" don't include the parameter valus.



Step 5: Add the "jp@gc - Flexible File Writer" from "listener" as a child to a ""jp@gc - Dummy Sampler" and 
 1. Enter the "FileName" with entire path
       Entire Path is : Total path like (C:\output.txt)
  2. Enter the "Record each sample as" as shown below .
                              requestData|,|responseData|\r\n|

   Here : for separating the comma(,) and \r\n, we are using the pipes(||) her.

See the more details below 

 

Step 6: Add the "View Result tree" listener to the ThreadGroup or Test Plan. Then the run the test and verify the file in C:\output.txt. It should contain below info 





No comments: