I'v just figured the problem out!!!!!!!!!!!
I specified the path thus
C:\Jmeter2.5\jakarta-jmeter-2.5.1\bin\${ID}.txt
The penny suddenly dropped. The path separator was being interpreted as an
escape character, and the dollar sign was then being treated literally
rather than as indicating the start of a variable to expand
So I tried escaping the last path separator like so:
C:\Jmeter2.5\jakarta-jmeter-2.5.1\bin\\${ID}.txt

and all was well :-), the variable now expands and my files are uploaded

thanks for getting back on this

Peri


On 24 April 2012 17:51, sebb <seb...@gmail.com> wrote:

> On 24 April 2012 17:02, Peri Stracchino <peri.stracch...@york.ac.uk>
> wrote:
> > Hello
> >
> > I hope I'v got the correct address here for the JMeter users discussion
> > list - apologies if not.
>
> Yes, it is the correct list.
>
> > I'm using JMeter 2.5.1
>
> There is a more recent version (2.6) but that's unlikely to be the issue
> here.
>
> > I want to run a test which requires a different external file to be sent
> > with each
> > request. I had hoped to do this by passing a variable into the File Path
> > (the one
> > under  'send files with the request'). this variable is read in from a
> csv
> > file
> > and would allow me to construct the unique part of the file name.
> >
> > the variable is specified like this
> > ID ${_StringFromFile(collnumsonly.txt)}
>
> Where are you defining this?
>
> > But this doesnt seem to work, because when I look at the error
> > message the variable hasnt been expanded - see below:
> > <responseData class="java.lang.String">java.io.FileNotFoundException:
> > C:\Jmeter2.5\jakarta-jmeter-2.5.1\bin\${ID}.txt (The system cannot find
> the
> > file
> > specified)
>
> This means that the variable cannot be resolved.
>
> > Is there any means by which I can do this in JMeter? Have i got my syntax
> > wrong or
> > am I simply trying to do something which wont work in jmeter? I'v googled
> > like a
> > very googly thing but cant seem to find an answer to this
>
> Syntax looks OK.
>
> There are two aspects to this:
> 1) is the variable being set up correctly and in time?
> 2) is the sampler set up correctly to use the variable?
>
> I would start by disabling reading from the external file.
> Define the ID variable as a fixed value on the Test Plan, and make
> sure the sampler works with the fixed value.
> Change the value and check it still works.
>
> Then try to read the variable from the file; use the Debug Sampler to
> show what variables are being set up.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
> For additional commands, e-mail: user-h...@jmeter.apache.org
>
>

Reply via email to