Bug 45267 - Feature request - loading property files from GUI
Summary: Feature request - loading property files from GUI
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2008-06-24 05:47 UTC by Krzysieq
Modified: 2008-06-24 06:42 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Krzysieq 2008-06-24 05:47:36 UTC
Not sure this is the right place to report such issue, as it is not really a bug, although in my project we tend to think of it this way...

It would be really nice, if it was possible to load a bunch of properties from a file after the application is started. It is a real pain in the neck to switch the app on and off just because we need to test another machine or environment. 

The way I would see this handled would be to add to the "User Defined Variables" configuration element a possibility to feed it from a file, as well as delete and sort the variables listed there. 

The other possible solution is to be able to switch, also during runtime, the file that is loaded as user.properties. But I imagine this would be more difficult.
Comment 1 Sebb 2008-06-24 05:54:34 UTC
Changing to enhancement.

The property dispay:


can be used to change/add/delete properties.

Would this be sufficient?
Comment 2 Krzysieq 2008-06-24 06:16:31 UTC
I see what You mean now, but I don't think this solves our problem. I can change the system or jmeter properties, but I cannot reload the additional property file - even changing the value of the user.properties property doesn't trigger the reload. If it would, this would be the best possible solution I think of. 

A little bit bigger picture:

What we have in our project is a property file per environment. Each of these has exactly the same keys, they only differ by the values. So we use the property names in all tests, and our automated testing campaigns supply the tests with different property files. This is easy and efficient when done commandline, but on the GUI we loose this, and what we're left with is an amazing pain in the neck of having to restart the GUI with another property file each time. Does this shed some light on the problem?
Comment 3 Sebb 2008-06-24 06:42:06 UTC
You can provide the initial property file on the GUI command line using the -q flag.

What you cannot do is reload an entire property file after starting the GUI.

However, nor can one run more than 1 test file using JMeter in non-GUI mode, so in that sense, the GUI is no different.

As a temporary work-round, you could use a beanshell function as the value of a dummy variable on the Test plan. This will be executed at the start of the test.

Something like:

DUMMY     ${__BeanShell(loadProperties("file.props"))}

where the method loadProperties is defined in a beanshell function init file.

The example .bshrc file already shows how to set JMeter properties so you would just need to load the new ones.