Use "CSV Data Set Config" element in your test-plan. Use there a few variables (3 or more) - assume there are {VAR1, VAR2, VAR3} (I'm using here "{ and }" for better explanation). Create data file for it. The first line has non-empty values - assume {1-1,1-2,1-3}. The second line has {2-1,2-2,} where the third value is empty (I need like this TC). So, when a thread is picking the second line from the CVS file - VAR3 value will be "1-3" (from previous line). ER: VAR3 value is equal to value from the second line - in this case - empty(nothing). The issue is valid only for the last variable in CVS file. I'm trying also to use (Allow quoted data = True) in the CVS file like {2-1,2-2,""} and it does not help as well.
The second line needs to be 2-1,2-2 If you use 2-1,2-2, or 2-1,2-2,"" then you are defining the 3rd column as the empty string.
Reopened That what I need - I need to have third parameter as empty string, but the value is not empty, it is equal the value from the previous line. Sorry, if the description is not clear. Assume, that CVS file has description {VAR1,VAR2,VAR3} and data are like these: 1st line: {1-1,1-2,1-3} 2nd line: {2-1,2-2,} - third parameter is empty AR(ActualResult): when 2nd line is processing ${VAR3} will be equal "1-3" (from previous line); ER(ExpectedResult): for 2nd line - ${VAR3} is equal "" (empty string); This is issue valid only for the last variable of CVS file.
Sorry for annoying... What are you going to do with this bug?
Created attachment 23172 [details] Data file
Created attachment 23173 [details] Test plan
Created attachment 23174 [details] Sample output
Works fine for me - see attached test plan etc. If it does not work for you, please reopen and attach the simplest possible test plan that shows the problem, together with data file and sample output.
Created attachment 23213 [details] my cvs file
Hi Sebb-2 I've attached simple "my cvs file" - 4 lines only. When I do a printing by beanshell it show incorrect value for the last line. Here is my beanshell script: ------- print ("TC="+vars.get("TC") + "::" + "ID="+vars.get("ID") + "EmailGroup="+vars.get("EMAIL-GROUP") + "<>Password="+vars.get("PASSWORD") + "<>FirstName="+vars.get("FIRSTNAME") + "<>LastName=" + vars.get("LASTNAME") + "<>Position=" + vars.get("POSITION") + "<>"); ------- Here are test-result: TC=SS-01-02-05::ID=aaa5EmailGroup=bluerealm.com<>Password=dadada<>FirstName=firs tName<>LastName= <>Position=5<> TC=SS-01-02-06::ID=aaa6EmailGroup=bluerealm.com<>Password=dadada<>FirstName=firs tName<>LastName=lastName<>Position=5<> ------- ER: the last line is shown as: TC=SS-01-02-06::ID=aaa6EmailGroup=bluerealm.com<>Password=dadada<>FirstName=firs tName<>LastName=lastName<>Position=null<> ========
I've also attached "simple TestPlan"
Created attachment 23214 [details] simple TestPlan
There is a subtle difference between the CSV Dataset settings in my test plan and yours - I put "Allow quoted data" = False, and you put True. Try setting the value to False and see if that solves the problem. It does for me. Of course, quoted data needs to behave the same as unquoted, so I'll investigate fixing that.
Yes, you are right. "Quoted" flag is causing the problem, but even I've quoted the last field (like, {a,b,""}) with "quoted"=True - it will not help. So, here are two "issues" (maybe related - I'm mean duplicated - this is just for myself when I a fix-verification will do): 1) "quoted" flag == True when data are non-quoted; 2) if the flag == True and data is quoted (all or partially) (like [a,b,""] or ["a","b",""] - it causes the problem as well;
Setting the "Allow quoted data flag" to true should not affect how *unquoted* data is treated. However at present the routine that processes quoted data doesn't handle a trailing delimiter correctly. I'm in the process of fixing that. If your data is not quoted, then don't set Allow Quoted = true. If your data is quoted, then you need to set Allow Quoted = true, but in that case you cannot set the last variable to empty, as the code treats {abc,} exactly the same as {abc,""}. This is a bug.
*** Bug 46651 has been marked as a duplicate of this bug. ***
Fixed in SVN in r740183: URL: http://svn.apache.org/viewvc?rev=740183&view=rev Log: Bug 46491 - Incorrect value for the last variable in "CSV Data Set Config" (error in processing quoted strings)
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2189