Forum Discussion

Jacob_Hassing's avatar
Jacob_Hassing
Contributor
16 years ago

add a where clause to assertion

i have below response, where i would like to make following assertion.
i would like to check that in the purchasestatus element where stockStatus = 1210 expectedDelivery should be = 08082010.
is it clear what i mean ? i guess it would look something this in a world i know :-)
(SELECT expectedDelivery from buyResponse where stockStatus = 1210) == 08082010

how should a assert like this be done ? suing script assert or can it be done in a regular expression?

 
     
       
            123
            1210
            08082010
       

       
            123
            1610
            07082010
       

     

 
  • Hello,

    Just use an XPath assertion! The following finds the purchasestatus element with the child StockStatus that is equal to 1210 and selects its child expectedDelivery's text content:


    //purchasestatus[stockStatus=1210]/expectedDelivery/text()


    Then as the expected result, just put 08082010.

    Regards,
    Dain
    eviware.com