Forum Discussion

sweetfa's avatar
sweetfa
Occasional Contributor
11 years ago

Attribute substitution failure when running from testcase

I have an interesting behavior in relation to SoapUI 5.0.0.

I have a HTTP Test Request Step configured to post text/xml.

Within the request I have attribute expansion on some of the attributes in the request similar to:

FirstServiceDate="${=pluto.ServiceDate.adjustDate(modelItem, 1)}"

Note that the reference is calling a java function that I have created and placed into a jar file in the bin/ext folder of my installation.

Now when I send the request using the request steps play button attribute substitution occurs as expected and the correct value for the attribute is placed in the Raw message content and dispatched appropriately.

However, when I run the test case that includes the test step the substitution instead placed the following error message into the output:

No signature of method: static pluto.ServiceDate.adjustDate() is applicable 

This would indicate that when the test step is being run that it can no longer find/use the java class in question.

Is this a deliberate limitation of the non-pro version in relation to request substitution or is there something more I need to do to get the class found when running a test case?

2 Replies

  • sweetfa's avatar
    sweetfa
    Occasional Contributor
    I have confirmed the same problem occurs in the PRO version of SoapUI.

    Is there some configuration setting I can change to allow it to work whilst running teststeps within a testcase?
  • sweetfa's avatar
    sweetfa
    Occasional Contributor
    The clue is in the wording of the error

    No signature of method .... is applicable

    SoapUI is actually finding the library, however the type of object that is passed through as a modelItem is different depending on whether it is being run from the TestStep or the TestCase.

    By changing the type of the modelItem to an AbstractModelItem the code then works.

    Be aware that different mechanisms provide different modelItem classes.