jmeter with maven and external groovy scripts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

jmeter with maven and external groovy scripts

András Csányi
Hi All,

I'd like to ask some help regarding how to achieve what I described in
the subject. I try to wrap my mind around what is needed for this. So
far I struggled to wire together them, but eventually maven can kick
off a jmeter test [1], and jmeter can execute an external groovy
script ( I had to copy all groovy files into
src/target/jmeter/testFiles directory and align external script path
accordingly in jmx file. But, this is the point where I faced the next
error. [2] To my knowledge the error says that whatever I copied into
the src/target/jmeter/testFiles directory it is not managed as groovy
library.

My idea how to solve this and I'd like to ask your review or advise.
There is a high chance I invented the hot water again... :)
There are two groovy files in my mind.
- Type A, where I describe methods, REST Api payloads, any reusable stuff
- Type B, where I call the methods in whatever order I want and these
files basically the Sampler scripts

The Type A groovy files should be in a separated maven project and
.jar packaged. Once these projects are built they have to copied into
src/target/jmeter/lib directory, so when jmeter starts it can read
them.

The Type B groovy files should be copied into
src/target/jmeter/testFiles directory, so jmeter will find these and
execute them, not to mention that the script paths will be way
simpler.

Did anyone from you achieved what I described above or similar?
Can you direct me to doc, blogs or articles which has examples how to
use external groovy scripts with jmeter in maven environment?

Thanks for any help!

[1] - https://blazemeter.com/blog/how-use-jmeter-maven-plugin/
[2] - https://stackoverflow.com/questions/56717085/jmeter-with-maven-and-using-external-groovy-scripts-issues-with-groovy-imports

- -
--  Csanyi Andras (Sayusi Ando)  -- http://sayusi.hu --
http://facebook.com/andras.csanyi
--  ""Trust in God and keep your gunpowder dry!" - Cromwell

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