ContributionsMost RecentMost LikesSolutionsRe: How to validate a email address from groovy scripting I did by below code. import net.sf.json.groovy.*; import net.sf.json.groovy.JsonSlurper; def Res = context.expand( '${Users - Request 1#Response}' ) def slurper = new JsonSlurper() def json = slurper.parseText Res def Email = json.email int i =0; Email.each() { assert Email[i].contains('@') log.info Email[i] i++ } How to validate a email address from groovy scripting import net.sf.json.groovy.*; import net.sf.json.groovy.JsonSlurper; def Res = context.expand( '${Users - Request 1#Response}' ) def slurper = new JsonSlurper() def json = slurper.parseText Res def Email = json.email From the above code I got an array of emails from my response data set. Now i want to check that all the emails has a "@" sign. and at least one "." . How can i do this. For now at least "@" verification is enough SolvedRe: Assert int value in an array What is it??? i cant understand what is the meaning on "it" in the context of groovy scripting aaronpliu wrote: int count = 0 price.each { if (it > 299) count++ } if (count > 0) assert false, "Not all price is greater than 299" .:robotmad: Assert int value in an array As on the image my responce data contains an array like this :300, 300, 300, 305, 310, 310, 310, 315, 320. I need to verify whether the each valu is greater than or equal to 299. But im getting this error. Is there any way to resolve this? SolvedRe: How to validate the 1st character of a responce data set I was able to do this by: def slurper = new JsonSlurper() def json = slurper.parseText response String countryList = json.result.values[0] def aa =countryList.take(1) How to validate the 1st character of a responce data set In my resonce i have to check the responce text is starting with letter "D" Is there any way to do this.So far i have able to get the entire 1st responce,But my gall is to validate whether the 1st responce text is starting with letter "D". SolvedRe: How to say set accept any value greater than Zero oops, This is not possible with the given UI, To perform you suggestion i have to use script assertion.` JHunt wrote: Hi, I don't know if that's possible with JsonPath Match assertion (I haven't used it much), but here's how you can do it with a Script assertion: def result = new groovy.json.JsonSlurper().parseText(context.response).'result' assert result > 0 How to say set accept any value greater than Zero As on the image i can do an assertion for the node $.result and now its value is 4. But is there any way where i can set this assertion to accept any value greater than Zero. Eg: if the node $.result is having 6 then my currant assertion will get fail because its looking for 4. Hope you can understand. Thanks. Re: Why my assertion is failing I was able to solve this issue by adding below aseertion. log.info myList log.info cityList assert myList == cityList assert cityList.equals(myList) Why my assertion is failing As on the image you can see Mylist and CityList are same. But at the assertion get failed.