You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sebb <se...@gmail.com> on 2006/04/06 19:44:50 UTC

Re: javascript in file names? Or changing default directory?

On 06/04/06, Sonam Chauhan <so...@ce.com.au> wrote:
> Hi Kornelis:
>
> > 1. File paths are relative to the JMeter\bin directory
> I think the file paths are relative to the current directory rather than
> to Jmeter\bin.
>
> So when I run JMeter - in Cygwin/Windows - from whatever current
> directory I am in, as in the following:
>        ../support/jakarta-jmeter-2.1.1/bin/jmeter  -t j.jmx -l jj.log
> -n
>
> ...the jj.log file is written to the current directory.
>
> Another idea: use Cygwin to simulate UNIX on windows.

File names are relative to the default (launch) directory.

The jmeter unix shell script works out the location of the JMeter bin
directory and uses it to find the initial jar file; it does not change
the current working directory.

However, the JMeter.bat command file changes directory to the bin
directory before starting JMeter, so any files are relative to the bin
directory.

I think originally JMeter had problems (on Windows) finding its jar
files if the starting directory was not the bin directory. This is why
the batch file changes directory if necessary.

Looks like this is no longer a problem, so it should be possible to
start JMeter anywhere. The only requirement is that it needs to find
the starting jar (obviously!).

>
> > 2. Javascript in the file name is not processed, so I can't enter
> > "${__P(user.dir)}\foo.bar" as a file name, if I do I get a new
> directory
> > under my bin directory called "${__P(user.dir)}" :-/
>
> I was having a look at just this right now... while this is true for the
> filename field in the 'View Results Tree' listener, you can use a JMeter
> variable (eg: 'debug_directory/${__P(my_test_id)' ) in the Filename
> prefix for 'Save Responses To File' post-processor. The example above
> saves files like this:
>        debug_directory/xyz1.xml
>        debug_directory/xyz2.xml
>        debug_directory/xyz3.xml
>
> However, there does not seem a way to correlate these responses to log
> entries -- ie. to actual samplers.

True, that would be useful. Also these files contain the response
content only; there is no timing etc information - the purpose is to
be able to check the content after a test run.

> Sincerely,
> Sonam Chauhan
> --
> Corporate Express Australia Ltd.
> Phone: +61-2-9335-0725, Email: sonam.chauhan@ce.com.au
>
> -----Original Message-----
> From: Kornelis Sietsma [mailto:korny@sietsma.com]
> Sent: Thursday, 6 April 2006 12:57 PM
> To: JMeter Users List
> Subject: javascript in file names? Or changing default directory?
>
> Hi all,
>
> I'm trying to write data using a Simple Data Writer, the basic
> functionality works but I have two problems:
> 1. File paths are relative to the JMeter\bin directory, not the
> "user.dir" setting or any other configurable setting I can find
> 2. Javascript in the file name is not processed, so I can't enter
> "${__P(user.dir)}\foo.bar" as a file name, if I do I get a new directory
>
> under my bin directory called "${__P(user.dir)}" :-/
>
> Does anyone know a way around this?  I'm trying to write tests that I
> can use on both a Windows and a Unix system so I don't want to use
> absolute paths, and I'd prefer not to have my log files written to the
> bin directory - especially if more than one user is running the same
> test on the same machine!
>
> - Korny
>
> --
> Kornelis Sietsma e-mail: korny at my surname dot 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
>
>

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


Re: javascript in file names? Or changing default directory?

Posted by Kornelis Sietsma <ko...@sietsma.com>.
sebb wrote:
> <snip>
> File names are relative to the default (launch) directory.
>
> The jmeter unix shell script works out the location of the JMeter bin
> directory and uses it to find the initial jar file; it does not change
> the current working directory.
>
> However, the JMeter.bat command file changes directory to the bin
> directory before starting JMeter, so any files are relative to the bin
> directory.
>
> I think originally JMeter had problems (on Windows) finding its jar
> files if the starting directory was not the bin directory. This is why
> the batch file changes directory if necessary.
>
> Looks like this is no longer a problem, so it should be possible to
> start JMeter anywhere. The only requirement is that it needs to find
> the starting jar (obviously!).
>   
Thanks - I had assumed that jmeter.bat changed directories for some good 
reason, so hadn't tried changing it.
I made a modified jmeter.bat that doesn't change directories, and now 
file loads/saves are relative to the start directory, which makes my 
file handling much simpler.

- Korny
p.s. the nightly jmeter build still doesn't quite fix the proxy problem 
- both the host and domain parameters of NTCredentials() have to be "", 
the latest build fixes the domain but not the host.
-- 
Kornelis Sietsma e-mail: korny at my surname dot com


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