Forum Discussion

kamahade's avatar
kamahade
Regular Contributor
14 years ago

MissingPropertyException

When I placed my groovy class in soapUI-Pro-3.5.1\bin\scripts\soapui\em3\releb folder and call function(static) like below,

soapui.em3.releb.comparefunction() it is giving below error....

Tue Sep 28 16:45:20 BST 2010:ERROR:groovy.lang.MissingPropertyException: No such property: soapui for class: Script19
groovy.lang.MissingPropertyException: No such property: soapui for class: Script19
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:241)
at Script19.run(Script19.groovy:10)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:51)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


my function also starts like this ..

package soapui.em3.releb;

It is NOT a arbitrary script, I have defined a valid class only.
I tried re-starting soapui as well.

I tested by placing demo/folder, greet class in this folder and it is working fine.

Do , I need to compile that class and keep in that folder?

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    It looks like you're trying to call a function directly in a package, without specifying a class.
    You should define the class with the same name as the groovy file itself, so for example: MyUtils.groovy should contain something along the lines of the following:


    package soapui.em3.releb

    class MyUtils {
    def static void comparefunction() {
    //Code goes here
    }
    }


    Which should be callabe from soapUI using:

    soapui.em3.releb.MyUtils.comparefunction()


    Also make sure that the Script Library setting in soapUI Preferences > soapUI Pro is correctly set to the scripts folder.

    Regards,
    Dain
    eviware.com