Forum Discussion

ppat7046_1's avatar
ppat7046_1
Occasional Contributor
7 years ago

Failed to dispatch using script; groovy.lang.MissingPropertyException: No such property: orderFound

I am getting error at if(orderFound == "True"). Can someone please tell me what I am doing wrong here?

 

def blockValue="XYZ";

def groovyUtils=new com.eviware.soapui.support.GroovyUtils(context)

def xml=new XmlSlurper().parseText(mockRequest.requestContent) xml.breadthFirst().each{

def v=it.toString()

 

if(it.name()=="order"){

     def orderFound="True";

}

 

   if(orderFound == "True"){

      log.info("WORKING.....");

   }

}

1 Reply

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi Prashant,

     

    The orderFound value will be defined only if the first condition is true. Maybe, you need to modify the script in the following way:

    def blockValue="XYZ";
    def groovyUtils=new com.eviware.soapui.support.GroovyUtils(context)
    def xml=new XmlSlurper().parseText(mockRequest.requestContent) 
    
    xml.breadthFirst().each{
    def v=it.toString()
     
    if(it.name()=="order"){
         def orderFound="True";
          log.info("WORKING.....");
       }
    }