ak0032803
14 years agoContributor
How to count number of specific child nodes from Respose?
Hi,
I am getting response some what similar to follwing format.
Now I want check how may coverages are retuned in response for all customers. There might me multiple customers, multiple areas and multiple locations. It depends on request data.
After that i want to compare it with a specific value defined for that test request.e.g. x
If it count of coverages matches with x then the test should pass else it should fail
any ideas how to do this using assertions or a groovy script ?
I am getting response some what similar to follwing format.
<Body>
<Customer1>
<Location1>
<Area1>
<Buildings>
</Buildings>
<Coverages>
</Coverages>
<Coverages>
<Coverages>
....
.....
<Coverages>
<Coverages>
</Area1>
<Area2>
</Area2>
<Location1>
<Location 2>
.........
..........
</Location 2>
</Customer1>
<Customer2>
.....
..........
</Customer2>
</Body>
Now I want check how may coverages are retuned in response for all customers. There might me multiple customers, multiple areas and multiple locations. It depends on request data.
After that i want to compare it with a specific value defined for that test request.e.g. x
If it count of coverages matches with x then the test should pass else it should fail
any ideas how to do this using assertions or a groovy script ?