Forum Discussion

arjunbardhan26's avatar
arjunbardhan26
Occasional Visitor
8 years ago

How to write an assertion to count number of elements in the response?

I need a help to write a script or X-path assertion to count the total number of elements returned in the response. Can anyone please help me write an assertion? I tried using the count X-path assertion but it is giving me 0 count all the time.

 

Thanks,

Arjun

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Please share more details such as raw response and what data you need to get. By the way, post what you tried and issue with it.
    • nagarajwst's avatar
      nagarajwst
      Occasional Contributor

      Instead of X-Path or any other assertion , you can use DataSink test step to export all elements in the response to external excel.

       

      Hope this will helps, if your requirement is different then pls ignore.