Contributions
Re: 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++ }6 years agoPlace ReadyAPI QuestionsReadyAPI Questions7KViews1like0CommentsHow 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 myresponsedata set. Nowiwant to check that all the emailshasa "@"sign. andat leastone "." . How canido this. For nowat least"@" verification isenoughSolved6 years agoPlace ReadyAPI QuestionsReadyAPI Questions6.8KViews0likes2CommentsRe: Assert int value in an array
What is it??? i cant understand what is the meaning on "it" in the context of groovy scripting aaronpliuwrote: int count = 0 price.each { if (it > 299) count++ } if (count > 0) assert false, "Not all price is greater than 299" .:robotmad:6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.2KViews0likes2CommentsAssert 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?Solved6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.2KViews0likes5CommentsHow 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 1stresponce text is starting with letter "D".Solved914Views0likes1CommentRe: How to say set accept any value greater than Zero
oops, This is not possible with the given UI, Toperform you suggestioni have to usescript assertion.` JHuntwrote: 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 > 01.3KViews0likes0CommentsHow 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.1.3KViews0likes2Comments