First let me preface this with 1) I'm not a developer by nature, and 2) I've only been using JMeter for less than 1 month.
I am performing basic CRUD testing of our APIs to/from our database. Due to a table constraint, each record in the table under test must have a unique typeId and groupId where the typeId/groupId combination is pre-defined elsewhere.
I need to perform the following upon a basic Create:
Path: /.../.../.../crud/QualificationExpression Method: POST
{
"id": null,
"displayName": "crudTest: ${__Random(1,10000000, randomNumber)}",
"functionName": null,
"displayableSourceExpression": "TRUE",
"clobObjId": null,
"typeId": xxx,
"groupId": yyy,
"typeCode": null
}
I'm trying to figure out what is the best way to do this:
- CSV file
- Array
- Array List
Searching the forums and other online resources, when people use a CSV they're typically using it to store username|passwords for random logins. This results in them using Parameters instead of a Post Body.
The Array examples all seem to contain a single column array where they pull a random value from within the array. However, I have a pair: if typeId = x, then objectId must = y.
Then I see an Array List sample where I'm totally confused:
ArrayList listOfPairs = new ArrayList();
ArrayList pair1 = new ArrayList();
pair1.add(203);
pair1.add(303);
listOfPairs.add(pair1);
ArrayList pair2 = new ArrayList();
pair2.add(204);
pair2.add(304);
listOfPairs.add(pair2);
ArrayList pair3 = new ArrayList();
pair3.add(205);
pair3.add(305);
listOfPairs.add(pair3);
for (int i = 0; i < listOfPairs.size(); i++) {
ArrayList pair = (ArrayList)listOfPairs.get(i);
System.out.println("pair:" + pair.get(0) + " " + pair.get(1));
}
My desire would be to not have a CSV file and it would be best to have the test plan .jmx be stand-alone without relying on "payload" files being present.
I'm hoping those with more experience and knowledge could provide some guidance and insight.