You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Rick <ri...@gmail.com> on 2009/09/22 21:27:24 UTC

Best Practice? I want to run different CsvDataSets depending on what environment I'm going to, is using ant file substitution ok?

I'm new to jmeter, but looked over the faq and wiki and dind't see
anything on this...

Currently each of my tests has a CSV DataSet associated with it. (I'm
doing this by setting up a ThreadGroup then my Sample test underneath
and then my CSV DataSet added to the test, hopefully that's the right
way to do it.)

What I want though is a way to use a different csv dataset file based
on whether I'm stress testing against dev, qa, prod, etc.

I was thinking of accomplishing this by giving my file name something
like @ENV@_myDataSet.txt  and then during the build for that
environment using ant, I just use file substitution to substitute the
correct ENV var. Is this a decent approach or is there a preferred
best practice?

Thanks

-- 
Rick R

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


Re: Best Practice? I want to run different CsvDataSets depending on what environment I'm going to, is using ant file substitution ok?

Posted by Rick <ri...@gmail.com>.
On Tue, Sep 22, 2009 at 4:55 PM, Rick <ri...@gmail.com> wrote:
>
>> You might consider passing the environment as a Jmeter property  in which
>> case you can specify a default.
>> ${__property(run.env,dev)}_myDataSet.txt

This is working wonderfully, much better than the ant approach.

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


Re: Best Practice? I want to run different CsvDataSets depending on what environment I'm going to, is using ant file substitution ok?

Posted by Rick <ri...@gmail.com>.
On Tue, Sep 22, 2009 at 3:54 PM, Deepak Shetty <sh...@gmail.com> wrote:
> if you can use ant  sure.  However note that your test wont work from gui or
> without this pre step
>
> You might consider passing the environment as a Jmeter property  in which
> case you can specify a default.
> ${__property(run.env,,dev)}_myDataSet.txt
>

Nice! I like that idea.

(The ant idea would work also and allow you to run from the gui..
albeit it would be a bit awkward since you'd have to modify the gui
test file (form the gui) which would have odd paths in it like
@ENV@_myDataSet.txt and then save it... THEN run ant which would
actually make for you a copy of the test script with the correct
substitutions and that copy is what you'd actually have to then start
up and run. Too many steps, I like the approach you mention much
better! Thanks.)

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


Re: Best Practice? I want to run different CsvDataSets depending on what environment I'm going to, is using ant file substitution ok?

Posted by Deepak Shetty <sh...@gmail.com>.
if you can use ant  sure.  However note that your test wont work from gui or
without this pre step

You might consider passing the environment as a Jmeter property  in which
case you can specify a default.
${__property(run.env,,dev)}_myDataSet.txt

something similar at
http://theworkaholic.blogspot.com/2009/06/testing-multiple-environments-with.html

regards
deepak

On Tue, Sep 22, 2009 at 12:27 PM, Rick <ri...@gmail.com> wrote:

> I'm new to jmeter, but looked over the faq and wiki and dind't see
> anything on this...
>
> Currently each of my tests has a CSV DataSet associated with it. (I'm
> doing this by setting up a ThreadGroup then my Sample test underneath
> and then my CSV DataSet added to the test, hopefully that's the right
> way to do it.)
>
> What I want though is a way to use a different csv dataset file based
> on whether I'm stress testing against dev, qa, prod, etc.
>
> I was thinking of accomplishing this by giving my file name something
> like @ENV@_myDataSet.txt  and then during the build for that
> environment using ant, I just use file substitution to substitute the
> correct ENV var. Is this a decent approach or is there a preferred
> best practice?
>
> Thanks
>
> --
> Rick R
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>