You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tong Sun <su...@gmail.com> on 2020/12/15 20:13:56 UTC

Prepare dynamic csv test data in setup thread

Hi,

I want to

- prepare dynamic csv test data in setup thread
- and use the generated .csv data for all other thread groups
- ideally, the name of the .csv is better be changed in the setup
thread as well.

How much of the above steps are possible?

Point 2 & 3 seems to be impossible to me at this point.

thx!

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


Re: Prepare dynamic csv test data in setup thread

Posted by Tong Sun <su...@gmail.com>.
On Wed, Dec 16, 2020 at 7:37 AM glinius@live.com <gl...@live.com> wrote:
>
> Everything is possible, just make sure to:
>
>  1. Use  setUp Thread Group
> <https://www.blazemeter.com/blog/how-use-setup-thread-group-jmeter-when-preparing-load-test>
> which is executed *before* other thread groups
>  2. If you want to make csv file names dynamic make sure to define them
> using  __setProperty() function
> <https://jmeter.apache.org/usermanual/functions.html#__setProperty>   in the
> setUp Thread Group and read them via  __P() function
> <https://jmeter.apache.org/usermanual/functions.html#__P>   in the "normal"
> Thread Groups

Sorry I can't get it to work. I'm getting

java.lang.IllegalArgumentException: File 1 must exist and be readable

It must be something simple but I just can't figure it out now. So
here is my code:

---------------------
CsvFile = "Test.csv"

log.info("CsvFile: ${CsvFile}")
props.put("CsvFile", CsvFile)
log.info("CsvFile: ${__P(CsvFile)}")
setProperty("CsvFile", CsvFile)
log.info("CsvFile: ${__P(CsvFile)}")
---------------------

And for that, I'm getting:

2020-12-16 16:48:49,970 INFO o.a.j.p.j.s.J.init: CsvFile: Test.csv
2020-12-16 16:48:49,970 INFO o.a.j.p.j.s.J.init: CsvFile: 1
2020-12-16 16:48:49,970 INFO o.a.j.p.j.s.J.init: CsvFile: 1

What's wrong? Thx!!

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


Re: Prepare dynamic csv test data in setup thread

Posted by "glinius@live.com" <gl...@live.com>.
Everything is possible, just make sure to:

 1. Use  setUp Thread Group
<https://www.blazemeter.com/blog/how-use-setup-thread-group-jmeter-when-preparing-load-test>  
which is executed *before* other thread groups
 2. If you want to make csv file names dynamic make sure to define them
using  __setProperty() function
<https://jmeter.apache.org/usermanual/functions.html#__setProperty>   in the
setUp Thread Group and read them via  __P() function
<https://jmeter.apache.org/usermanual/functions.html#__P>   in the "normal"
Thread Groups 



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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