Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to get array item count and then increased total count by +1

abhaysabu
abhaysabu Posts: 7

I've a scenario to add item into array using POST call. Now I've to validate whether the item is added into array list or not, so will check array size increased by +1 or not. I will use GET call to get count of array before and after POST call. Any solution? Here JSON Data Bank may not work, even if get a total count, but how to add +1 to increase the count.

Example:
Test1 : GET call -> count=3(+1)=4
Test2: POST call -> add item
Test3: Get call - > get count by Occurrence Assertion, 4=Test1 count

Comments

  • goofy78270
    goofy78270 Posts: 130

    just use the Occurrence assertion

    or write the count in xpath
    count(..your path to count fields...)