Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 21061

Simple for loop throws exception

$
0
0

Exception: "

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script16.groovy: 30: 3 expressions are required for the classic for loop, you gave 4 at line: 30 column: 7. File: Script16.groovy @ line 30, column 7. for ( i=1; i="m"; i++Smiley Wink ^ org.codehaus.groovy.antlr.ASTParserException: 3 expressions are required for the classic for loop, you gave 4 at line: 30 column: 7. File: Script16.groovy @ line 30, column 7. at org.codehaus.groovy.antlr.AntlrParserPlugin.buildAST(AntlrParserPlugin.java:263) at org.codehaus.groovy.control.SourceUnit.convert(SourceUnit.java:272) at  ......."
 
when a simple for loop is executed as shown below:
import com.eviware.soapui.support.types.StringToStringMap 
import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder( "Get Publications#Response" )
 
holder.namespaces["ns1"] = "http://www.w3.org/2005/Atom"
holder.namespaces["c"] = "http://iddn.com/ns/core"
holder.namespaces["f"] = "http://iddn.com/ns/fields"
holder.namespaces["a"] = "http://iddn.com/ns/assets"
holder.namespaces["s"] = "http://iddn.com/ns/search"
 
 
//def m = context.expand( '${Get Publications#Response#declare namespace ns1=\'http://www.w3.org/2005/Atom\'; declare namespace s=\'http://iddn/ns/search\'; //ns1:feed[1]/s:request[1]/sSmiley Surprisedptions[1]/s:max-results[1]}' )
 
 
def m = holder.getNodeValue( " //ns1:feed[1]/s:request[1]/sSmiley Surprisedptions[1]/s:max-results[1]}" )
 
 
//for ( i in products.values())
for ( i=1;  i="m"; i++Smiley Wink
{
 
def products = holder.getNodeValue("//ns1:feed[1]/ns1:entry[i]/ns1:content[1]/s:entitlement-bundle[1]/s:c_name[1]")
 
 
log.info( products);
}

Viewing all articles
Browse latest Browse all 21061

Trending Articles