chathurad
6 years agoContributor
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...
- 6 years ago
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++ }