How to loop through and assert JSON array objects in JMeter if they have the same name?How do I turn a C# object into a JSON string in .NET?How to use Jackson to deserialise an array of objectsJMeter: How to count JSON objects in an Array using jsonpathJmeter - Json array: How to check for each value if contains a string using Json Path ExtractorLoop through 2 arrays containing array and array of objects - PhpSchema validation for Json array of objects using JavaJMeter Non GUI mode Test Execution number of samples mismatchingHow to assert a JSON response which have results in random order every time in JMeter?Using JMeter, how to compare table data with JSON data?jMeter: JSON assertion
Magento 2 setTemplate and add content to phtml template
Was Donald Trump at ground zero helping out on 9-11?
How did Biff return to 2015 from 1955 without a lightning strike?
How do I respond appropriately to an overseas company that obtained a visa for me without hiring me?
ULQ2003 not driving a Relay properly
Should 2FA be enabled on service accounts?
How char is processed in math mode?
If I buy and download a game through second Nintendo account do I own it on my main account too?
Derivative is just speed of change?
What is the term for completing a route uncleanly?
Can there ever be any problem when using gedit to edit system files with 'sudo -H gedit'?
Why don't short runways use ramps for takeoff?
What is the oxidation state of Mn in HMn(CO)5?
How would a lunar colony attack Earth?
UX writing: When to use "we"?
Planting Trees in Outer Space
Best Ergonomic Design for a handheld ranged weapon
How to innovate in OR
Is it possible to tell if a child will turn into a Hag?
What do the novel titles of The Expanse series refer to?
Why are prop blades not shaped like household fan blades?
Balancing Humanoid fantasy races: Elves
What force enables us to walk? Friction or normal reaction?
Academic progression in Germany, what happens after a postdoc? What is the next step?
How to loop through and assert JSON array objects in JMeter if they have the same name?
How do I turn a C# object into a JSON string in .NET?How to use Jackson to deserialise an array of objectsJMeter: How to count JSON objects in an Array using jsonpathJmeter - Json array: How to check for each value if contains a string using Json Path ExtractorLoop through 2 arrays containing array and array of objects - PhpSchema validation for Json array of objects using JavaJMeter Non GUI mode Test Execution number of samples mismatchingHow to assert a JSON response which have results in random order every time in JMeter?Using JMeter, how to compare table data with JSON data?jMeter: JSON assertion
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have the below JSON response to be validated. I need to validate all the "createdDate" from all the Arrays irrespective. Is there any easy way to capture them or loop through them (since it has the same object name, but in different arrays) and put them in variables to do an assertion against their corresponding values from a JDBC response?
Right now I have used JSON Assertion for each and every "createdDate" using the JSON path to validate against the database value.
"someobject1": 123,
"Array1":
[
"someobject2": 2,
"createdDate": "2019-03-26T20:29:44.631+0000",
"someobject3": "SCRIPT1"
,
"someobject4": 3,
"createdDate": "2019-03-27T20:29:44.631+0000",
"someobject5": "SCRIPT2"
],
"Array2":
[
"someobject6": 4,
"createdDate": "2019-03-28T20:29:44.631+0000",
"someobject7": "SCRIPT3"
,
"someobject8": 5,
"createdDate": "2019-03-29T20:29:44.631+0000",
"someobject9": "SCRIPT4"
]
json jmeter assertion
add a comment |
I have the below JSON response to be validated. I need to validate all the "createdDate" from all the Arrays irrespective. Is there any easy way to capture them or loop through them (since it has the same object name, but in different arrays) and put them in variables to do an assertion against their corresponding values from a JDBC response?
Right now I have used JSON Assertion for each and every "createdDate" using the JSON path to validate against the database value.
"someobject1": 123,
"Array1":
[
"someobject2": 2,
"createdDate": "2019-03-26T20:29:44.631+0000",
"someobject3": "SCRIPT1"
,
"someobject4": 3,
"createdDate": "2019-03-27T20:29:44.631+0000",
"someobject5": "SCRIPT2"
],
"Array2":
[
"someobject6": 4,
"createdDate": "2019-03-28T20:29:44.631+0000",
"someobject7": "SCRIPT3"
,
"someobject8": 5,
"createdDate": "2019-03-29T20:29:44.631+0000",
"someobject9": "SCRIPT4"
]
json jmeter assertion
add a comment |
I have the below JSON response to be validated. I need to validate all the "createdDate" from all the Arrays irrespective. Is there any easy way to capture them or loop through them (since it has the same object name, but in different arrays) and put them in variables to do an assertion against their corresponding values from a JDBC response?
Right now I have used JSON Assertion for each and every "createdDate" using the JSON path to validate against the database value.
"someobject1": 123,
"Array1":
[
"someobject2": 2,
"createdDate": "2019-03-26T20:29:44.631+0000",
"someobject3": "SCRIPT1"
,
"someobject4": 3,
"createdDate": "2019-03-27T20:29:44.631+0000",
"someobject5": "SCRIPT2"
],
"Array2":
[
"someobject6": 4,
"createdDate": "2019-03-28T20:29:44.631+0000",
"someobject7": "SCRIPT3"
,
"someobject8": 5,
"createdDate": "2019-03-29T20:29:44.631+0000",
"someobject9": "SCRIPT4"
]
json jmeter assertion
I have the below JSON response to be validated. I need to validate all the "createdDate" from all the Arrays irrespective. Is there any easy way to capture them or loop through them (since it has the same object name, but in different arrays) and put them in variables to do an assertion against their corresponding values from a JDBC response?
Right now I have used JSON Assertion for each and every "createdDate" using the JSON path to validate against the database value.
"someobject1": 123,
"Array1":
[
"someobject2": 2,
"createdDate": "2019-03-26T20:29:44.631+0000",
"someobject3": "SCRIPT1"
,
"someobject4": 3,
"createdDate": "2019-03-27T20:29:44.631+0000",
"someobject5": "SCRIPT2"
],
"Array2":
[
"someobject6": 4,
"createdDate": "2019-03-28T20:29:44.631+0000",
"someobject7": "SCRIPT3"
,
"someobject8": 5,
"createdDate": "2019-03-29T20:29:44.631+0000",
"someobject9": "SCRIPT4"
]
json jmeter assertion
json jmeter assertion
edited Mar 26 at 22:10
sjkp
asked Mar 26 at 21:26
sjkpsjkp
207 bronze badges
207 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can use JSON Assertion configured like:
- Assert JSON Path Exists:
$..createdDate - Expected Value:
["2019-03-26T20:29:44.631+0000","2019-03-27T20:29:44.631+0000","2019-03-28T20:29:44.631+0000","2019-03-29T20:29:44.631+0000"]
Full configuration:

More information:
JSON Path: Deep Scan Operator- JSON Path Examples
- JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55366452%2fhow-to-loop-through-and-assert-json-array-objects-in-jmeter-if-they-have-the-sam%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use JSON Assertion configured like:
- Assert JSON Path Exists:
$..createdDate - Expected Value:
["2019-03-26T20:29:44.631+0000","2019-03-27T20:29:44.631+0000","2019-03-28T20:29:44.631+0000","2019-03-29T20:29:44.631+0000"]
Full configuration:

More information:
JSON Path: Deep Scan Operator- JSON Path Examples
- JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
add a comment |
You can use JSON Assertion configured like:
- Assert JSON Path Exists:
$..createdDate - Expected Value:
["2019-03-26T20:29:44.631+0000","2019-03-27T20:29:44.631+0000","2019-03-28T20:29:44.631+0000","2019-03-29T20:29:44.631+0000"]
Full configuration:

More information:
JSON Path: Deep Scan Operator- JSON Path Examples
- JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
add a comment |
You can use JSON Assertion configured like:
- Assert JSON Path Exists:
$..createdDate - Expected Value:
["2019-03-26T20:29:44.631+0000","2019-03-27T20:29:44.631+0000","2019-03-28T20:29:44.631+0000","2019-03-29T20:29:44.631+0000"]
Full configuration:

More information:
JSON Path: Deep Scan Operator- JSON Path Examples
- JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios
You can use JSON Assertion configured like:
- Assert JSON Path Exists:
$..createdDate - Expected Value:
["2019-03-26T20:29:44.631+0000","2019-03-27T20:29:44.631+0000","2019-03-28T20:29:44.631+0000","2019-03-29T20:29:44.631+0000"]
Full configuration:

More information:
JSON Path: Deep Scan Operator- JSON Path Examples
- JMeter's JSON Path Extractor Plugin - Advanced Usage Scenarios
answered Mar 27 at 6:01
Dmitri TDmitri T
80k3 gold badges41 silver badges70 bronze badges
80k3 gold badges41 silver badges70 bronze badges
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
add a comment |
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
Is it possible to compare it one to one. In case if one of them fails, can any of the listeners tell?
– sjkp
Mar 27 at 17:49
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55366452%2fhow-to-loop-through-and-assert-json-array-objects-in-jmeter-if-they-have-the-sam%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown