Ask a Question

need help with setNodeValue

anu
Occasional Contributor

need help with setNodeValue

Hi,

I am new to soapui. I am trying to write a groovy script to read the data from a file and pass them as parameters to the request in the next step.

my xml in the second step is as follows


 

 
     
        bbb
        aa2
        2
        10.20.30.40
     

 


my groovy script in the first step is as follows
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

//create holder for last response an log requistID
def holder = groovyUtils.getXmlHolder( "ses:company#request" )

log.info holder.getNodeValue

holder.setNodeValue( "//ses:company", "ccc" )

holder.updateProperty()

This however is throwing an error
Fri Jan 25 18:37:00 PST 2008:ERROR:org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA

Can you pl. help me. I do not think I am doing it right.
1 REPLY 1
omatzura
Super Contributor

Hi!

is "sec:company" really the name of your Request Test Step? ie as specified in the expression for getXmlHolder in

def holder = groovyUtils.getXmlHolder( "ses:company#request" )

which maybe should be something like

def holder = groovyUtils.getXmlHolder( "Test Request 1#request" )

?

regards!

/Ole
eviware.com
cancel
Showing results for 
Search instead for 
Did you mean: