apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.3k stars 2.09k forks source link

HTTP Sampler does not process var/func refs correctly in first file parameter #2212

Closed asfimport closed 14 years ago

asfimport commented 15 years ago

Mandar K Nadgouda (Bug 46901): Hi,

I have a script to upload a file. I have modified the file path to pick it from the csv file instead. Though the csv file have multiple rows the script is not proceeding to the second row i.e the same file is being sent in the request for each iteration/loop.

This was working fine with version 2.3.1. Please let me know the changes to be made in case I need to fix this one.

Votes in Bugzilla: 2 Severity: blocker OS: Windows XP

Duplicates:

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): How are you reading the CSV file?

Please attach a simple test plan that works under 2.3.1 and fails under 2.3.2. Remove any sensitive data first.

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): The "Submit File for Upload" HTTP Request uses send files with the request to upload files. The ${importFile} is being picked up from the "CSV Data Set Config"

The first file name is passed to all the "Import Location" iterations in JMeter 2.3.2 r665936. The second iteration should move on to the next row within "CSV Data Set Config"

Created attachment Import_Locations.jmx: Script to upload location

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): Added a script as attachment. I am using JMeter 2.3.2 r665936. The attached script fails on this release since the same file name mentioned in row 1 of the CSV Data Config is picked up by all iterations.

The same file works on 2.3.1. I cannot use 2.3.1 for other scripts developed due to some other issues.

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): The test plan is not exactly "simple".

Which sampler is failing?

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): To put it precisely any HTTP Request with at least one file in the "Send Files With the Request" fails when I parameterize the File path as in ${importFile} and then run it through iterations. The ${importFile} gets replaced for the first iteration with appropriate file name but for next iteration picks the same file path instead of proceeding further.

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): I think this has been fixed in SVN - could you try the nightly build and see if that works for you?

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): No its still giving me the same issue both the first iteration and second iteration are picking the same file.

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): I have tried with jakarta-jmeter-r753086.

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): Please note: I do have some other parameters along with the File to be sent with the request as well

asfimport commented 15 years ago

Mandar K Nadgouda (migrated from Bugzilla): Any updates on this. When is the next release of Jmeter? Will this be fixed by then? Is there any alternative I can go ahead with?

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): I have found that the problem does exist - I thought it was solved in the current nightlies, but not so.

It's not yet clear how to fix this, so I can't say when a fix will be released.

However, I have found that the problem only affects the first file in the list, which is treated differently for compatibility reasons.

If you can put up with sending a dummy file as well, then you can use JMeter 2.3.2 or a nightly. Otherwise you will have to use JMeter 2.3.1.

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): This seems to be working OK now.

Please test one of the nightlies and report back.

asfimport commented 15 years ago

muru (migrated from Bugzilla): I tried to verify this issue against the release jmeter version 2.3.3 and it is still exist. It always pick up the first file name.

But, the same script works like charm in 2.3.1 version. I am not sure what got fixed in 2.3.3 because the behavoir still the same as in 2.3.2

I need to do diff in source to see what changes were made between 2.3.1 to 2.3.3

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): Created attachment httpfile.jmx: Sample test plan

httpfile.jmx ````xml false false false 3 1 1 1222035558000 1222035558000 false continue , httpfile.csv false true All threads false T localhost 8080 POST false true true false f${T}.tmp p${T} m${T} false false saveConfig true true true true true true true false true true false false true false false false false false 0 true ````
asfimport commented 15 years ago

Sebb (migrated from Bugzilla): Created attachment httpfile.csv: Sample test data

httpfile.csv ```` 1 2 3````
asfimport commented 15 years ago

Sebb (migrated from Bugzilla): It works fine for me with the attached test plan and CSV file.

Create 3 dummy files - f1.tmp, f2.tmp, f3.tmp and start the mirror-server.

You should see that the files are correctly uploaded.

asfimport commented 15 years ago

SteveH (migrated from Bugzilla): I'm seeing this bug on v2.3.3 and v2.3.4.

I'm using HTTP Request HTTPClient Sampler. I'm using a variable name for "File Path". The variable is changed in a BeanShell preprocessor. In a loop I'm posting a file to a server. The first file name generated in the beanshell keeps getting posted over and over even though I verified that the variable is getting changed.

asfimport commented 15 years ago

SteveH (migrated from Bugzilla): I verified that it works correctly on 2.3.1 and is broken on all releases after that.

asfimport commented 15 years ago

SteveH (migrated from Bugzilla): BUMP

asfimport commented 14 years ago

muru (migrated from Bugzilla): please, fix this issue soon

asfimport commented 14 years ago

Sebb (migrated from Bugzilla): This has taken a long while to fix, but as can be seen from the change it was not trivial. [It might have been fixed earlier had there been a simple test case.]

The changes will be in nightly builds from r905484.

URL: http://svn.apache.org/viewvc?rev=905484&view=rev Log: https://github.com/apache/jmeter/issues/2212 - HTTP Sampler does not process var/func refs correctly in first file parameter Simplify file handling at run-time by using only a single list which is merged at start-up if necessary.

Added: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBaseConverter.java (with props) Modified: jakarta/jmeter/trunk/bin/saveservice.properties jakarta/jmeter/trunk/bin/testfiles/AssertionTestPlan.jmx jakarta/jmeter/trunk/bin/testfiles/AuthManagerTestPlan.jmx jakarta/jmeter/trunk/bin/testfiles/GuiTest.jmx jakarta/jmeter/trunk/bin/testfiles/GuiTest231.jmx jakarta/jmeter/trunk/bin/testfiles/HeaderManagerTestPlan.jmx jakarta/jmeter/trunk/bin/testfiles/InterleaveTestPlan.jmx jakarta/jmeter/trunk/bin/testfiles/InterleaveTestPlan2.jmx jakarta/jmeter/trunk/bin/testfiles/LoopTestPlan.jmx jakarta/jmeter/trunk/bin/testfiles/Modification Manager.jmx jakarta/jmeter/trunk/bin/testfiles/OnceOnlyTestPlan.jmx jakarta/jmeter/trunk/bin/testfiles/SimpleTestPlan.jmx jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java jakarta/jmeter/trunk/xdocs/changes.xml