You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Andrei Ghimus <gh...@gmail.com> on 2010/11/08 20:52:46 UTC
Successive calls to __StringFromFile return the same value
Good day!
I'm calling
word1=${__StringFromFile(query.txt)} word2=${__StringFromFile(query.txt)}
and I expect ${word1} and ${word2} to have different values
(specifically, ${word2} to get the value from the following line).
This does not happen i.e. ${word1} and ${word2} have the same value.
Any idea why? And if this is not the way to do it, maybe someone could
offer an alternative.
Thanks in advance.
P.S.: JMeter 2.4
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Successive calls to __StringFromFile return the same value
Posted by sebb <se...@gmail.com>.
On 8 November 2010 20:10, Andrei Ghimus <gh...@gmail.com> wrote:
> On Mon, Nov 8, 2010 at 9:00 PM, sebb <se...@gmail.com> wrote:
>> On 8 November 2010 19:52, Andrei Ghimus <gh...@gmail.com> wrote:
>>> Good day!
>>>
>>> I'm calling
>>> word1=${__StringFromFile(query.txt)} word2=${__StringFromFile(query.txt)}
>>> and I expect ${word1} and ${word2} to have different values
>>> (specifically, ${word2} to get the value from the following line).
>>> This does not happen i.e. ${word1} and ${word2} have the same value.
>>
>> What test element have you used them in?
> Java Request sampler.
>>
>>> Any idea why?
>>
>> Subtle bug, because SFF generally works OK.
(it's been a long while since I used the function...just as well it is
documented.)
It's not a bug, this is by design, see:
http://jakarta.apache.org/jmeter/usermanual/functions.html#__StringFromFile
"If there are multiple references to the function in a test script,
each will open the file independently, even if the file names are the
same."
It's intended for passing a single item of information to a sampler.
You could either split the file into two, or join the lines and use
__split to split them.
>>
>>> And if this is not the way to do it, maybe someone could
>>> offer an alternative.
>>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config
> The description for CSV Data Set Config says that lines are only read
> at the start of an iteration. I need to read the next line at each
> call. Can I do that?
No, but you can put the element in a nested loop.
>>
>>> Thanks in advance.
>>>
>>> P.S.: JMeter 2.4
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Successive calls to __StringFromFile return the same value
Posted by Andrei Ghimus <gh...@gmail.com>.
On Mon, Nov 8, 2010 at 9:00 PM, sebb <se...@gmail.com> wrote:
> On 8 November 2010 19:52, Andrei Ghimus <gh...@gmail.com> wrote:
>> Good day!
>>
>> I'm calling
>> word1=${__StringFromFile(query.txt)} word2=${__StringFromFile(query.txt)}
>> and I expect ${word1} and ${word2} to have different values
>> (specifically, ${word2} to get the value from the following line).
>> This does not happen i.e. ${word1} and ${word2} have the same value.
>
> What test element have you used them in?
Java Request sampler.
>
>> Any idea why?
>
> Subtle bug, because SFF generally works OK.
>
>> And if this is not the way to do it, maybe someone could
>> offer an alternative.
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config
The description for CSV Data Set Config says that lines are only read
at the start of an iteration. I need to read the next line at each
call. Can I do that?
>
>> Thanks in advance.
>>
>> P.S.: JMeter 2.4
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Successive calls to __StringFromFile return the same value
Posted by sebb <se...@gmail.com>.
On 8 November 2010 19:52, Andrei Ghimus <gh...@gmail.com> wrote:
> Good day!
>
> I'm calling
> word1=${__StringFromFile(query.txt)} word2=${__StringFromFile(query.txt)}
> and I expect ${word1} and ${word2} to have different values
> (specifically, ${word2} to get the value from the following line).
> This does not happen i.e. ${word1} and ${word2} have the same value.
What test element have you used them in?
> Any idea why?
Subtle bug, because SFF generally works OK.
> And if this is not the way to do it, maybe someone could
> offer an alternative.
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config
> Thanks in advance.
>
> P.S.: JMeter 2.4
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org