Where on a remote workstation should I put a CSV-c

2019-06-20 04:40发布

问题:

I want to make JMeter distributed testing. It was said in the manual that first I should start jmeter-server on remote nodes, and then I should update jmeter.config and run jmeter on a master node.

I did all these steps. My test plan includes working with CSV-config files. If I test just from 1 (master) node - then everything works as a charm. But when I try distributed testing all tests fail. Some investigation showed that remote nodes send requests without substitution of ${..}-like parameters. Requests look like

POST data: 5|0|6|http://host.com/portal/|67D1C612DCF291DCD0F71AD15E404F37|host.ui.client.services.LoginService|login|java.lang.String/2004016611|${ADMIN_LOGIN}|1|2|3|4|3|5|5|5|6|6|1|

It's obvious that remote jmeter-server cannot find the CSV-file. Where should I put it?

P.S: I have machines with different OS (Windows 7 and Ubuntu 10.04).

回答1:

The easiest way to resolve the multiple OS issue is to put the CSV file in the Jmeter BIN directory on all test machines, and do not reference the path in the CSV Data Set Config component.



回答2:

Put a full path and filename into your 'CSV Data Set Config' component, eg. c:\loadtest\config.csv and ensure that you put the CSV file in the place that is specified.


The components manual also states the following:

Relative file names are resolved with respect to the path of the active test plan.

So it should be possible to put the file in the same directory as the test plan file. This ought to work in both Linux and Windows.



回答3:

Any reference to data file assumes that such a file exists in respective nodes in the specified path. For example, if you have your CSV files in C:\data, then when you execute the test plan in a distributed fashion, the testplan would look for the data file in C:\data of the node (the slave).

In effect, if you are using 10 slave machines, you need to have c:\data folder in all those 10 machines.

There is no need to copy test plan.



回答4:

EDITED because the docs reference was wrong - I got burned by my own answer :)

Old question, but I just ran into this issue and the answers here are conflicting.

Is a relative path resolved to the bin/ directory, or to the directory of the current .jmx test script?

Answer: it is only the directory of the test script. From the docs:

Relative file names are resolved with respect to the path of the active test plan. Absolute file names are also supported, but note that they are unlikely to work in remote mode, unless the remote server has the same directory structure. If the same physical file is referenced in two different ways - e.g. csvdata.txt and ./csvdata.txt - then these are treated as different files. If the OS does not distinguish between upper and lower case, csvData.TXT would also be opened separately.