Forum Discussion

PM's avatar
6 years ago

Script Assertion on XML Response - Need to chk if the child node exist, if so need to chk text



Is there any easiest way to check the existence of the element in the response and if exist , then need to check if a Text is present in each of the client node. 


Here is eg;-


fetching the collection of CustomerContactRecords, if record exist then it would fetch me all contacts records from DB based on the search in the request. 


Validation : If Collection exist then check for the search text in each child notes.


Can someone pls help me, 

3 Replies

    • PM's avatar

      Refer the attached Response XML , where i need to validate or check for First Name - 'b' value in the child records.


      See, i am sending an request to fetch data of records containing 'b' as First Name , so i get two collection of records,  now i need to check if the records received in the response contains First Name - 'b' .

      • nmrao's avatar
        Champion Level 3
        There are two records like you said. But one is in upper case and another one is lower case.

        What do you need to check? both need to have the value in lower case?