jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: Successive calls to __StringFromFile return the same value
Date Tue, 09 Nov 2010 03:06:00 GMT
On 8 November 2010 20:10, Andrei Ghimus <> wrote:
> On Mon, Nov 8, 2010 at 9:00 PM, sebb <> wrote:
>> On 8 November 2010 19:52, Andrei Ghimus <> 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

It's not a bug, this is by design, see:

"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

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.
> 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:
For additional commands, e-mail:

View raw message