Forum Discussion

zhaoj66's avatar
zhaoj66
New Contributor
14 years ago

Three simple questions - as entry level

I use SoapUI version. Some problems I meet.
1> log
I designed two steps in test case. Everyone is groovy script. In each groovy script, when running, in 'log output', I can see log info. But if I run as test case, in 'testcase log', I can't see any log info I print out in the groovy script. I use 'log.info' in groovy script. Why?

2> testCaseResult, teststepResult
When you create groovy script, the variable you can use is context, messageexchange, testrunner, log. How to visit object testcaseResult or teststepresult. Any code example?

3> javadoc
Anywhere, can I get the updated javadoc for soapui API?

Thank you very much, for your answers.

4 Replies

  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    Hi,

    To answer your first question, the reason you don't see the output from your script in "test case" is because the test case consists of different test steps and it will give output of the result of these test steps i.e. whether the test step passed or fail. To see detailed log, of everything that is run, look at the script log at the bottom of the screen which would contain info on what you are looking for.

    2. I am not sure, what exactly you are trying to do here, please elaborate.

    3. soapui api docs are available here:
    http://www.soapui.org/apidocs/

    and groovy api docs are here:
    http://groovy.codehaus.org/api/index.html

    Let me know if this helps.

    Regards,
    Deepesh Jain
  • zhaoj66's avatar
    zhaoj66
    New Contributor
    Really appreciate your help, Jain. It works. I already found log info in 'script log' window.

    For second question, sorry to confuse you. There hasn't TestcaseResult or TeststepResult object. I want to use groovy script to output test case result and test step result to external xml files. Any code example?

    DOC are very useful. Jain, do you know where to get more examples in using API?

    Thank you, very much!

    Jenny
  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    Hi Jenny,

    For second question, testStepResult is not a class, its an interface. So you can't create an empty object, however, you can access an its object, if some method returns an object of this type. For example:

    def abc = testRunner.runTestStepByName("YOUR_TEST_STEP_NAME") ;

    abc will hold an object of "testStepResult" type. You can now invoke methods on this object like:

    def stats = abc.getStatus();

    Thanks,
    Deepesh Jain