Forum Discussion

rafalk128's avatar
rafalk128
Occasional Contributor
16 years ago

Re: Test results not counting steps executed by Groovy

I have a Groovy step which executes a step in a loop  several times with different parameters. It looks as though the results from the steps executed by Groovy are not reported in the TestSuite log individually but summarized and reported as one step. Is it possible to have Groovy write a result for each step executed? Thanks.

9 Replies

  • Hello,

    How exactly are you executing these teststeps? Can you post your groovy code? If you are using the runTestStepByName method the teststeps should be individually logged.

    Regards,
    Dain
    eviware support
  • rafalk128's avatar
    rafalk128
    Occasional Contributor
    Sure... ignore the if count>5 .. as you can see i'm new to Groovy ...

    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

    groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
    holder = groovyUtils.getXmlHolder("Products1#Response" )

    def targetStep = testRunner.testCase.getTestStepByName( "Products2" );
    count = 0
    for( url in holder["//Response/Product/ConfigToken"] )
    {
    if (count >5) return; count++
    targetStep.setPropertyValue( "configToken", url);
    targetStep.run(testRunner, context);
    }
  • rafalk128's avatar
    rafalk128
    Occasional Contributor
    It looks like testRunner.runTestStepByName executed the test case however the assertions are not executed when triggered by Groovy. Thanks.
  • rafalk128's avatar
    rafalk128
    Occasional Contributor
    Just updated to the last nightly build. It is still not executing the assertions for each step executed programmatically. Thanks.
  • Hi!

    hmm.. how are you validating that the assertions are not being run? Are you expecting something to fail? Or do you have a script-assertion that is not being executed?

    regards!

    /Ole
    eviware.com
  • rafalk128's avatar
    rafalk128
    Occasional Contributor
    Thanks for your message again. I have a suite of 7 REST service steps and two Groovy steps.There are 21 assertions scattered through the REST steps. Each of the Groovy steps executes particular step step 6 times for different parm so total 19 steps executed. The 2 steps executed in a loop have 5 assertions and 4 assertions each - that should be additional 30 + 24 assertions reported. The test runner only reports 21 assertions. Thanks again.

    SoapUI 2.5.2 TestCaseRunner Summary
    -----------------------------
    Time Taken: 101643ms
    Total TestSuites: 1
    Total TestCases: 1 (0 failed)
    Total TestSteps: 19
    Total Request Assertions: 21
    Total Failed Assertions: 0
    Total Exported Results: 19
  • star's avatar
    star
    Occasional Contributor
    just a note,  my assertions won't even get reported  on the Test result page even if they failed. I havd to "Save all Projects" each time i perform a change before things start working.