jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: CSV Data Set Config not expanded in JUnit Constructors
Date Mon, 14 Jan 2013 17:22:23 GMT
On 14 January 2013 09:11, Jørgen Austvik <jaustvik@acm.org> wrote:
> Hi,
>
> I have problems getting CSV Data into my JUnit constructors. Other
> JMeter variables work OK.
>
> My test plan look like this:
> Test Plan
> |- Thread Group
>    |- CSV Data Set Config
>    |- Debug Sampler
>    |- JUnit Request
>
> (One thread group containing a CSV Data Set Config, A Debug Sampler
> and a JUnit request.)
>
> The Debug Sample logs only JMeter variables.
>
> The JUnit request is simple:
>
>     public JUnitTest(String initializerString) {
>         System.out.println("Constructed using: '" + initializerString + "'");
>     }
>
>     @Test
>     public void scenarioViewCustomerTest() {}
>
> The Constructor String Label for the JUnit 4 test has a string like this:
>
>   ${BANKID},${SSN},${START.MS},text
>
> The Debug Sampler shows that BANKID and SSN are read correctly from my CSV file:
>   BANKID=1234
>   SSN=12345678910
>   START.MS=1358152968114
>   (among other variables)
>
> When I run the test, I get START.MS substituted, but *not* the
> variables from my CSV file:
>
>   Constructed using: '${BANKID},${SSN},1358152968114,text'
>
> For the Debug Sampler output above, I would expect:
>
>   Constructed using: '1234,12345678910,1358152968114,text'
>
> I have tried to move the CSV Data Set Config to the top and bottom of
> the test plan instead of having it inside the thread group, with the
> same result (no variable substitution).
>
> Am I doing anything wrong or is this a bug? (I have seen this problem
> in the latest nightly build (r1432785) and v2.8).

See http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config

"CSV Dataset variables are defined at the start of each test
iteration. As this is after configuration processing is completed,
they cannot be used for some configuration items - such as JDBC Config
- that process their contents at configuration time (see Bug 40394 )
However the variables do work in the HTTP Auth Manager, as the
username etc are processed at run-time. "

> Best Regards,
> Jørgen Austvik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message