I have this kind of request
{
"ID":"112345"
"SERVICE":"56AA77"
}
The API response could be positive or negative with different element.
positive response:
{
"RESPONSE":"OK"
"TEXT":"DONE"
}
negative response:
{
"RESPONSE":"KO"
"DESCRIPTION":"NOT FOUND"
"ERROR_CODE":"100"
}
how can I tested with JMeter using only one HTTP Request Sampler and only one CSV file ?
Actually I'm using two csv files:
positive:
TEST_ID,TEST_DESC,ID,SERVICE,RESPONSE,TEXT
negative:
TEST_ID,TEST_DESC,ID,SERVICE,RESPONSE,DESCRIPTION,ERROR_CODE
is it possible to use only one file ? like this:
TEST_ID,TEST_DESC,ID,SERVICE,RESPONSE,TEXT,DESCRIPTION,ERROR_CODE
how Jmeter can handle this?
UPDATE:
I've two JSON Assertion objects

is it possible to create BeanShell groovy to call one of those based on the ResponseCode ?
if (prev.getResponseCode().equals("200") == true) {
checkResponsePositive
}
else
{
checkResponseNegative
}
could someone help me with the right syntax?


