xstoka
14 years agoNew Contributor
LoadUI Custom Component To Parse XML
Hello, I have just started with LoadUI and really like it but have come accross an problem i cant seem to get past, if anyone can help me it will be much appreicated!
I am creating a LoadUI custom component that reads an XML file from disk and then parses the document based on its content. This is the part i can not get to work.
I have a groovy script working within SoapUI that performs this functionality i want using the com.eviware.soapui.support.GroovyUtils (getXmlHolder), however when i try and run this script in a LoadUI custom component i get the following error...
"unable to resolve class com.eviware.soapui.support.groovyutils"
From reading up on various web pages it might be that this class is not loaded as it is an external class, however being a newbie to this i am not sure how to solve it, maybe i can not use the groovyutils in loadui and have to parse my XML another way?
Any help would be much appreciated.
Thank you
Here is the code i have for my simple component (MyComponent.groovy)
I am creating a LoadUI custom component that reads an XML file from disk and then parses the document based on its content. This is the part i can not get to work.
I have a groovy script working within SoapUI that performs this functionality i want using the com.eviware.soapui.support.GroovyUtils (getXmlHolder), however when i try and run this script in a LoadUI custom component i get the following error...
"unable to resolve class com.eviware.soapui.support.groovyutils"
From reading up on various web pages it might be that this class is not loaded as it is an external class, however being a newbie to this i am not sure how to solve it, maybe i can not use the groovyutils in loadui and have to parse my XML another way?
Any help would be much appreciated.
Thank you
Here is the code i have for my simple component (MyComponent.groovy)
// input and Ouput
createInput( "input", "Incoming Messages" )
createOutput( "output", "Outgoing Messages" )
// Actions
runAction = null
// Action Methods
onAction( "RUNONCE" )
{
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info("Do Load XML document")
}
// Layout
layout {
box( layout:'wrap 2, ins 0' ) {
runAction = action( label:'Run Once', action: {
triggerAction('RUNONCE')
})
}
}