There's no easy way to get the test file name currently.

However, you can define a property on the command line and reference
that using the __P() function, for example:

jmeter -n -t testcase.jmx -Jtest=testcase

With a bit of OS know-how you could write a shell script to do this
automatically.

I don't know what you mean by "Testcase name".
The sampler name can be obtained as mentioned by Noel below.

On 05/10/2009, Noel O'Brien <[email protected]> wrote:
> Hi,
>
>  Any of the beanshell elements will give you access to a ctx object ( 
> org.apache.jmeter.threads. JMeterContext), so I think the following should 
> work:
>
>  ctx.getCurrentSampler() .getName();
>
>  Regards,
>
> Noel
>
>
>  ----- "Marco Pas" <[email protected]> wrote:
>  > Hi i was wondering is it is possible to retrieve the Testcase name
>  > automatically or the filename of the current running test this to enable
>  > dynamic naming of the different samplers.
>  > I have a couple of different files that contain different test and when
>  > running jmeter on all those test it would be nice that the test themselves
>  > append the filename of the testcase name on the sampler namers.
>  >
>  > Something like:
>  >
>  > ${TESTCASENAME}-.... etc etc
>  > or
>  > ${CONTROLLERNAME}-....
>  >
>  > I know i can use a User Defined variable in the testcase but would like to
>  > use dynamic naming so if i move the test to another file or something that 
> i
>  > do not have to worry abou the naming.
>  >
>  > Greetings
>  >

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to