Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
16 years ago

soapui 2.5.1 failing groovy teststep when using testrunner

Hello,
This is a weird one. I have a testcase where there is a groovy step like this

GlobalFunctions gb = new GlobalFunctions("Properties", "Email");
gb.VerifyUserEmail(testRunner);


If I run this testcase via the GUI testcase editor it passes without any issue.

But when i run the same testcase using testrunner I get the following error (see attachment)

6 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    we made a change to the groovy classloading in one of the later builds; script-library classes have to be in a folder corresponding to their package name, could this be the cause here? What package is GlobalFunctions in? Is it in a corresponding folder in the Script Library? Are you importing the package in your script?

    Sorry about this change, but there were other class-dependency issues that could not be resolved in any other way..

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    i am not sure if I understand.
    What do you mean when you say

    "script-library classes have to be in a folder corresponding to their package name"

    How do I what is my package name

    Thanks

    Ali
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    it means that if you script has a package declaration at the top:

    package my.useful.classes

    then the file has to be in a folder names my/useful/classes

    Could this be the cause of your problems?

    regards!

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    my script declaration looks like this

    import groovy.sql.Sql
    import java.sql.SQLException 
    import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory
    import com.eviware.soapui.impl.wsdl.support.wsdl.CachedWsdlLoader
    import com.eviware.soapui.impl.wsdl.endpoint.DefaultEndpointStrategy.EndpointDefaults
    import java.text.SimpleDateFormat
    import com.eviware.*

    class GlobalFunctions extends ConfigureGlobalVariable
    {
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    hmm.. in that case this is not the cause (and it works in the UI anyhow). You should see in the log which folder that is being used as script-library, is it correct when running from command-line?

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    ok.. so it seems like the issue was the script library. for some reason the script library location in soapui-settings.xml was not the same as the one defined in the preferences tab.

    After doing save preferences in the UI thereby updating the settings.xml file, the testrunner works fine.