You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by EricPortelance <er...@inm.com> on 2010/08/17 16:58:32 UTC

Problem with relative paths

Hello

I have a problem with relative paths.
I read in other posts
(http://jmeter.512774.n5.nabble.com/Relative-Path-Issue-td523826.html#a523827
) that JMeter looks up relative files based on the current working
directory. 
But in my case, it doesn't seem to work, it seems to start at my C:­\

I need to send a file (test01.jpg) in an http request. The only way it works
is if I put the image in C:\ and put "/test01.jpg" in the filepath field.

Is there any way to make it relative to the jmx file or the jmeter.bat file?

Thank you.


-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Problem-with-relative-paths-tp2638261p2638261.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Problem with relative paths

Posted by Felix Frank <ff...@mpexnet.de>.
You may want to try and open a DOS prompt, navigate to the folder
containing your jmx file and launch jmeter from there.

Alternatively, you could possibly manipulate Windows's executable
options for Jmeter to use the working dir you want, but I'm not
proficient enough with Windows to elaborate on that.

HTH,
Felix

On 08/17/10 16:58, EricPortelance wrote:
> 
> Hello
> 
> I have a problem with relative paths.
> I read in other posts
> (http://jmeter.512774.n5.nabble.com/Relative-Path-Issue-td523826.html#a523827
> ) that JMeter looks up relative files based on the current working
> directory. 
> But in my case, it doesn't seem to work, it seems to start at my C:­\
> 
> I need to send a file (test01.jpg) in an http request. The only way it works
> is if I put the image in C:\ and put "/test01.jpg" in the filepath field.
> 
> Is there any way to make it relative to the jmx file or the jmeter.bat file?
> 
> Thank you.
> 
> 

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


Re: Problem with relative paths

Posted by sebb <se...@gmail.com>.
On 17 August 2010 15:58, EricPortelance <er...@inm.com> wrote:
>
> Hello
>
> I have a problem with relative paths.
> I read in other posts
> (http://jmeter.512774.n5.nabble.com/Relative-Path-Issue-td523826.html#a523827
> ) that JMeter looks up relative files based on the current working
> directory.

That is the case for any Java application, not just JMeter.

> But in my case, it doesn't seem to work, it seems to start at my C:­\

What is the evidence for this failure?

> I need to send a file (test01.jpg) in an http request. The only way it works
> is if I put the image in C:\ and put "/test01.jpg" in the filepath field.
>
> Is there any way to make it relative to the jmx file or the jmeter.bat file?

This would require special processing of file names, for example as in:
Bug 43389 - Allow Include files to be found relative to the current JMX file

This has not been implemented for generic file lookup, as it might
cause existing tests to fail.
But it might be worth making it an optional feature (e.g. via a JMeter
property which defaults to false) in a future release.

Note also that you can define a variable on the test plan and use it
in conjunction with file names.

e.g.

BASEDIR = ../abc/def/

and use it as:

${BASEDIR}filename.txt

> Thank you.
>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Problem-with-relative-paths-tp2638261p2638261.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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