JMeter - How to read a properties file

My JMeter project is as follows.

project
    |
     ----> test (folder containing .jmx)
    |
     ----> properties (folder containing .properties files)

In non-gui mode, I can pass the .properties file name to the test via the command line - which I know.

But how can I read this properties file in GUI mode during debugging? I do not want to place them in the bin folder. Is there any other way? how is the configuration item? Is it easy to write your own configuration item to read the properties file?

+4
source share
3 answers

I also had the same requirement. Easy to write configuration item.

Refer to this. http://www.testautomationguru.com/jmeter-property-file-reader-a-custom-config-element/

+2
source

- JMeter, GUI, -q :

jmeter.bat -q d:\somefolder\somefile.properties

, .. .properties Beanshell Sampler :

FileInputStream is = new FileInputStream(new File("d:/somefolder/somefile.properties"));
props.load(is);
is.close();

, , , __ () __ P().

Apache JMeter Beanshell . BeanShell: JMeter .

+7

enter image description here

Add "tag-jmeter-extn-1.1.jat" to the ext of your jmeter. Then you can easily use Property file Reader

My THScript.properties looks below

TH_Performance_ScriptName = Web.jmx Performance_TestData = C: / Result /

Access to property file values:

$ {__ P (Performance_TestData)}

+1
source

All Articles