Forum Discussion

Hellotest's avatar
Hellotest
Contributor
2 years ago

Check for empty value in groovyscript

In Groovy script in Ready API , trying to extract a value from Response and based on it if it null or not, need to write next few steps.

But value which is returning is [].

Then if I check with null or "" it does not work .

How do I check if value is [].

Please suggest

  • You are getting JSON Array in response with no elements in ti.

    So, you can check the size is zero or not.

  • nmrao's avatar
    nmrao
    Champion Level 3

    You are getting JSON Array in response with no elements in ti.

    So, you can check the size is zero or not.