Reputation: 5142
I want to test a resource that gets a token in the URL.
for example: localhost:8080/api/{TOKEN}/function
I want JMeter to choose from a list of 4 different tokens. is it possible?
Upvotes: 0
Views: 668
Reputation: 168197
Everything is possible given JMeter is open source.
If you have i.e. 4 User Defined Variables containing tokens like:
You can get a random one for the each request using __V() and __Random() functions combination like:
${__V(TOKEN_${__Random(1,4,)})}
So you can change "Path" of the HTTP Request Sampler to look like:
/api/${__V(TOKEN_${__Random(1,4,)})}/function
and that should be it. See Here’s What to Do to Combine Multiple JMeter Variables article for more details.
Upvotes: 1