Forum Discussion

Manimaran's avatar
Manimaran
Occasional Contributor
12 years ago

How to get the total characters available in XML response

Hi,
Is there anyway that i can get the total size and total string length (total no of characters in the XML response) of the response through Groovy? I have a test which displays response xml which has more than 33,000 characters. When i try to write my result in the excel file, it throws error. So i want to do a validation before writing in excel, such that if my response xml has more than 25,000 characters, i need to skip my writing. Please help me on this.

3 Replies

  • Manimaran's avatar
    Manimaran
    Occasional Contributor
    Hi,
    Thanks for the info. Sorry if i am missing something, i am not seeing any details related to counting of response length. Please help me.
  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1
    Yes, that does not have what exactly you are looking for. However, it has the details how you can read the response xml.
    You may achieve what your are looking for if you can convert xml object to string, is not it so? then use string length.