Forum Discussion

leskop's avatar
leskop
Occasional Contributor
13 years ago

Placeholder for Groovy scripts

Hello,

Since I have project, which is hard to test with standard assertions provided by SoapUI, I need to create a lot of "Custom Script" ones. Placing such scripts (methods) in TestCase or TestSuite is unpractical, same as have stored them in external file(s).

Is there any other way to store them at one place a and use only calls of them in assertions/setup scripts? It may reduce project size finaly, improve readability, and maybe performance too
  • nmrao's avatar
    nmrao
    Champion Level 3
    Hi,

    I do face the same.

    And it is also hard to debug script in soapUI if something goes wrong. For now, i am using eclipse for writing & debug scripts and place them here in soapUI groovy step later and add soapUI's context and all later.

    Even if scripts are written, if some test cases re-uses that it has to be copied from existing location.

    For me, it is required to make the custom assertions on a certain response.
    Defined a Suite --> Test Case
    this includes Test Steps
    Request
    Groovy --> Saves the response of the above request in a temporary file so that it can be passed to java code, calls java code which is created for makeing those assertions (initially do not have much idea on groovy, so went to java here, you may ignore that part if familiar with groovy)

    And cloning this TestCase for each test case i needed. As you rightly mentioned, it increase project size.

    Alternately there is another possibility to include a step called Run Testcase, a test case defined above can be referred (may be this wont increase project size), not explore though.

    Regards,
    Rao.