In that case, I don't see how you can use a fixed relative path unless
you mimic what the buildserver does.
Nor does it seem possible to calculate the relative path at run-time
unless you know the absolute paths of both the file and the JMeter
starting directory.
However, you should be able to use a variable relative (or absolute)
path (using a property).
You can default this for the buildserver, and override it on the
command-line otherwise.
E.g. on the test plan
DATADIR ${__P(datadir,../testdir/)}
on the command-line:
jmeter -Jdatadir=../../x/testdir ...
and in the test plan sampler:
${DATADIR}import.txt
On 09/09/2009, Marco Pas <[email protected]> wrote:
> Could be a solution, but the testcases are also used and started by our
> buildserver. As far as i know i can not influence the startingpoint of that.
>
> 2009/9/9 sebb <[email protected]>
>
>
> > On 09/09/2009, Marco Pas <[email protected]> wrote:
> > > Hi there, i am using a hardcoded directory inside a test that succesfully
> > > send the contents via a http request. Now i want to get rid of the
> > hardcoded
> > > directory and am searching for a way on how to get the current directory
> > > from the current executing tests.
> > >
> > > Any relative paths i tried seem not to work.
> > >
> > > My test in in a directory called testplans and so is my file that i want
> > to
> > > upload. When loading the test via the gui i tried several relative path
> > > settings but the test is unable to find the file i want to send.
> > >
> > > directory: testcases contains the testplan and import .txt file so i
> > tried
> > > to use ../import.txt ./import.txt and just plain import.txt so far no
> > > succes..
> > >
> > > Is there any way using beanshell or whatever to retrieve the current
> > > directory of the testplan that is executing?
> >
> > Just start JMeter in the testcases directory.
> >
> > > Greetings marco
> > >
> >
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]