Hi
My GET Method response is like below, But when i do get once the Id changes and the place "journals|0_0_7|JOURNALS_PART_ONE" and "journals|0_0_7|JOURNALS_MAPPING" changes, that is some times "journals|0_0_7|JOURNALS_MAPPING" comes 2nd in the response and some times it will come last.
So i require a groovy script depending upon the Pack id i must get the "id" and parameterize that "id" to the next request.
"dependencies" : [
{
"id" : 13311,
"pack_id" : "journals|0_0_7|PART_TWO",
"status" : "not_started",
"output" : null,
"run_id" : null
},
{
"id" : 13312,
"pack_id" : "journals|0_0_7|PART_ONE",
"status" : "complete",
"output" : null,
"run_id" : ""
},
{
"id" : 13313,
"pack_id" : "journals|0_0_7|MAPPING",
"status" : "waiting",
"output" : [
{
],
Hope the question is clear and please help in groovy script.
Thanks
Solved! Go to Solution.
Thanks.
However, it appears that you have picked up part of the response from middle of a response.
Using below similar type of solution, you should be able to work it out for the original response.
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/json/QueryRelativeData.groovy
Need complete hierarchy of the response, it is fine even if it is sample one if you still have issues.
Hi @nmrao
The Pack_id :""pack_id" : "journals|0_0_7|PART_ONE", remains fixed, where as for this pack_id i have to pick the id and parameterize to next request, But the node value for pack_id keep changing i said eariler the pack_id : journals|0_0_7|PART_ONE, will be coming last in the response , The id value will keep changing. Status doesnt matter.
So in the below response, if ""pack_id" = "journals|0_0_7|PART_ONE", i have to pick the id for this pack_id and parameterize to the next request.
"dependencies" : [
{
"id" : 13311,
"pack_id" : "journals|0_0_7|PART_TWO",
"status" : "not_started",
"output" : null,
"run_id" : null
},
{
"id" : 13312,
"pack_id" : "journals|0_0_7|PART_ONE",
"status" : "complete",
"output" : null,
"run_id" : ""
},
{
"id" : 13313,
"pack_id" : "journals|0_0_7|MAPPING",
"status" : "waiting",
"output" : [
{
],
Thanks
Subject | Author | Latest Post |
---|---|---|