Solved
Forum Discussion
New2API
7 years agoFrequent Contributor
richie, here is what you can do to overcome this Uppercase' issue. it is bit ugly but may work.
import net.sf.*
import net.sf.json.*
import net.sf.json.groovy.*
import groovy.json.JsonSlurper
def response = new File(context.expand( '${#TestSuite#ResponsePath}') + 'Untitled1.json').text
def slurper = new JsonSlurper()
def json = slurper.parseText response
def actual = []
json.data.DataSourceId_Name.each{
actual = actual+it //Get all DataSourceId_Name
}
//Get unique value from the 'actual' array and loop through
actual.unique().each{
log.info it
it.toUpperCase() == it //Convert each array element to uppercase and compare it to itself
}