AnsweredAssumed Answered

I am new to DevTest. Can the tool do assertions/filters on collections/lists of data in a given req/resp?  See detail:

Question asked by Lisa_Holdener on Nov 9, 2015
Latest reply on Nov 23, 2015 by Lisa_Holdener

Is there a way to do assertions on collections in DevTest? Let's say we are testing a webservice.
We want to send the following request and expect to get the response with the amounts below.  We are really
interested to know the response for chargeType = 92222. So our "charge service" can have multiple charges per
customer that are not necessarily in the same order for a given req/resp. Is there a feature
in DevTest we can use to validate that (in this example) chargeType 92222 returned the
expected amount of 1.50? Or does a script need to be written?


request for charges and payments for a given customer:
<detail>
        <general>
            <customerNo>11111</customerNo>
            <storeNo>1234</storeNo>
       </general>
        <account>
            <AccountNo>8888888888</AccountNo>
            <customerName>Test Customer1</customerName>
            <companyName>Test Company1</companyName>
        </account>
        <charge>
            <chargeType>91111</chargeType>
            <chargeDesc>Fruit</chargeDesc>
        </charge>
        <charge>
     <chargeType>92222</chargeType>
     <chargeDesc>Veggies</chargeDesc>
        </charge>
        <charge>
      <chargeType>93333</chargeType>
      <chargeDesc>Bread</chargeDesc>
        </charge>    
        <payment>
            <paymentType>CASH</paymentType>          
        </payment>
         <payment>
     <paymentType>CHECK</paymentType>   
        </payment>
  </detail>
   
  response for charges and payments for a given customer:
  <detail>
          <general>
              <customerNo>11111</customerNo>
              <storeNo>1234</storeNo>
         </general>
          <account>
              <AccountNo>8888888888</AccountNo>
              <customerName>Test Customer1</customerName>
              <companyName>Test Company1</companyName>
          </account>
           <charge>
      <chargeType>93333</chargeType>
      <chargeDesc>Bread</chargeDesc>        
      <charge>3.25</charge>
          </charge>
          <charge>
              <chargeType>91111</chargeType>
              <chargeDesc>Fruit</chargeDesc>        
              <charge>5.00</charge>
          </charge>
          <charge>
         <chargeType>92222</chargeType>
      <chargeDesc>Veggies</chargeDesc>        
      <charge>1.50</charge>
          </charge>
          <payment>
              <paymentType>CASH</paymentType>
              <amount>3.25</amount>
          </payment>
              <payment>
    <paymentType>CHECK</paymentType>
       <amount>6.50</amount>
          </payment>
  </detail>

Outcomes