-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect value for the last variable in "CSV Data Set Config" - when the value is empty #2189
Comments
Sebb (migrated from Bugzilla): 2-1,2-2 If you use 2-1,2-2, then you are defining the 3rd column as the empty string. |
Yaroslav (migrated from Bugzilla): 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. AR(ActualResult): when 2nd line is processing ${VAR3} will be equal "1-3" (from previous line); This is issue valid only for the last variable of CVS file. |
Yaroslav (migrated from Bugzilla): What are you going to do with this bug? |
Sebb (migrated from Bugzilla): csv46491.csv
|
Sebb (migrated from Bugzilla): csv46491.jmx<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="csv46491" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">4</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1232802288000</longProp>
<longProp name="ThreadGroup.end_time">1232802288000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
<stringProp name="delimiter">,</stringProp>
<stringProp name="fileEncoding"></stringProp>
<stringProp name="filename">csv46491.csv</stringProp>
<boolProp name="quotedData">false</boolProp>
<boolProp name="recycle">true</boolProp>
<stringProp name="shareMode">All threads</stringProp>
<boolProp name="stopThread">false</boolProp>
<stringProp name="variableNames">A,B,C</stringProp>
</CSVDataSet>
<hashTree/>
<JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Java Request" enabled="true">
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="Sleep_Time" elementType="Argument">
<stringProp name="Argument.name">Sleep_Time</stringProp>
<stringProp name="Argument.value">100</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="Sleep_Mask" elementType="Argument">
<stringProp name="Argument.name">Sleep_Mask</stringProp>
<stringProp name="Argument.value">0xFF</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="Label" elementType="Argument">
<stringProp name="Argument.name">Label</stringProp>
<stringProp name="Argument.value">A=${A} B=${B} C=${C}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="ResponseCode" elementType="Argument">
<stringProp name="Argument.name">ResponseCode</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="ResponseMessage" elementType="Argument">
<stringProp name="Argument.name">ResponseMessage</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="Status" elementType="Argument">
<stringProp name="Argument.name">Status</stringProp>
<stringProp name="Argument.value">OK</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="SamplerData" elementType="Argument">
<stringProp name="Argument.name">SamplerData</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="ResultData" elementType="Argument">
<stringProp name="Argument.name">ResultData</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="classname">org.apache.jmeter.protocol.java.test.JavaTest</stringProp>
</JavaSampler>
<hashTree/>
</hashTree>
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="View Results in Table" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename">csv46491.jtl</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan> |
Sebb (migrated from Bugzilla): csv46491.jtl
|
Sebb (migrated from Bugzilla): 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. |
Yaroslav (migrated from Bugzilla): testcsv.txt
|
Yaroslav (migrated from Bugzilla): I've attached simple "my cvs file" - 4 lines only.
|
Yaroslav (migrated from Bugzilla): |
Yaroslav (migrated from Bugzilla): TestCVS.jmx<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">storeshop3.qa.bluerealm.com</stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
</ConfigTestElement>
<hashTree/>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
<stringProp name="delimiter">,</stringProp>
<stringProp name="fileEncoding"></stringProp>
<stringProp name="filename">testcsv.txt</stringProp>
<boolProp name="quotedData">true</boolProp>
<boolProp name="recycle">false</boolProp>
<stringProp name="shareMode">All threads</stringProp>
<boolProp name="stopThread">true</boolProp>
<stringProp name="variableNames">TC,ID,EMAIL-GROUP,PASSWORD,FIRSTNAME,LASTNAME,POSITION</stringProp>
</CSVDataSet>
<hashTree/>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="SS-01 - Register a new account" enabled="true">
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1229016075000</longProp>
<longProp name="ThreadGroup.end_time">1229016075000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true">
<stringProp name="IfController.condition">"${TC}" != "#"</stringProp>
<stringProp name="IfController.evaluateAll">false</stringProp>
</IfController>
<hashTree>
<BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="BeanShell Sampler" enabled="true">
<stringProp name="BeanShellSampler.query">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") + "<>");</stringProp>
<stringProp name="BeanShellSampler.filename"></stringProp>
<stringProp name="BeanShellSampler.parameters"></stringProp>
<boolProp name="BeanShellSampler.resetInterpreter">true</boolProp>
</BeanShellSampler>
<hashTree/>
</hashTree>
</hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan> |
Sebb (migrated from Bugzilla): 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. |
Yaroslav (migrated from Bugzilla): So, here are two "issues" (maybe related - I'm mean duplicated - this is just for myself when I a fix-verification will do):
|
Sebb (migrated from Bugzilla): 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. |
Sebb (migrated from Bugzilla): URL: http://svn.apache.org/viewvc?rev=740183&view=rev |
Yaroslav (Bug 46491):
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.
Severity: normal
OS: Windows XP
Duplicates:
The text was updated successfully, but these errors were encountered: