Harman
Harman

Reputation: 85

Parameterized API, separate reports in JMeter

So here’s my scenario:

I am testing an API with a set of users (use CSV Data Set config to read txt file of users). I have to test the above API for the same set of users but with different Campaign ids (approx. 10 ids). Initially i had Campaign id defined as a User Defied variable and i would update the value of this variable with the Campaign id i wanted to test.

Now i automated the whole process (using Maven-JMeter plugin and run in Jenkins).

For this manually updating Campaign id will not work nor i can create 10 separate jmx files (one for each campaign id).

So i created another txt file with Campaign ids and used another CSV Config to read Campaign ids.

For e.g. Campaigns.txt (CampaignType, CampaignId)

Campaign A, 100

Campaign B, 200

Campaign C, 300

UserId.txt contains 100000
100001
100002
…..
200000

My test structure is as below:
* Thread Group
* Campaigns CSV
* HTTP Request
* Userid CSV

This approach does not work either since for every Campaign id it is a different test but reports contains all Campaigns combined.
My requirement is to be able to use the same jmx file with same set of users with a different Campaign Type and get individual reports.

Can someone please suggest me a strategy to achieve this goal ?

Thanks for your help in advance !

Upvotes: 1

Views: 74

Answers (1)

RowlandB
RowlandB

Reputation: 573

Assuming you're running this Non-GUI and passing the -l flag to get your report:

One test run = one report. There's no way to get around that. So the best solution is to automate multiple tests. If you do this, you can pass each separate test a different Property by using the -J flag (or -G if doing remote testing). You would then access that property in your test by using ${__P(CampaignId)}.

Upvotes: 1

Related Questions