regex - How to use Regular Expression extractor for output data of- 6002:6005:93974309c3f042a69b20c9f9c38a13e3 -


in service response output below :

6002:6005:93974309c3f042a69b20c9f9c38a13e3 

there no other things come in output ,it returns above value ,i want write values 1 local file requests.

option 1: add value .jtl results file:

  1. add regular expression extractor child of request returns value , use following regular expression extractor configuration:

    • reference name: meaningful, i.e. serviceresponse
    • regular expression: (.*)
    • template: $1$
  2. in user.properties file add next line:

    sample_variables=serviceresponse 

    upon next execution see column in results .jtl file containing values extracted response. see sample variables chapter of jmeter's user manual more information.


option 2: writing variables separate file

  1. instead of regular expression extractor add beanshell postprocessor child of request returns value.
  2. put following code postprocessor's "script" area:

    import org.apache.commons.io.fileutils;  fileutils.writestringtofile(new file("/path/to/your/file.txt"),new string(data) + system.getproperty("line.separator"), true); 

    the above code uses fileutils.writestringtofile() method store whole response arbitrary file. see how use beanshell: jmeter's favorite built-in component article more information on using java , jmeter api beanshell test elements in jmeter test.

n.b. if plan produce high load go option 1.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -