Forum Discussion

autoscout24's avatar
autoscout24
Contributor
16 years ago

Test case logs and Image upload issue

Hi Support team,

I am writing this again because I have posted same question in the forum but for some reason, i don't know it is deleted. It would be great if you guys answer the following questions.

1. We are running the test case in the command prompt (test runner). We have tear down step in all the test cases to report the test result to the test management tool. After the end of the test the test runner is writing some results to the specified result folder (esp. when the test is failed, I can see lot of information like soap request and response, time stamps etc.) is it possible collect all the logs of the test case from the beginning to the end of the test case and storing it to an array or variable, so the we can use those content in the Test management tool ?

2.We have image upload test, where we use about 15 files as attachments and each sized about 1 MB. When we run the test in the command prompt the memory consumption of java shoots up. For eg. before running the test the memory 351 kb after the test 581 kb(monitored in windows task manager) this problem is also noticed in Soap GUI. Is there any that we add to the end of the test case so that it clears the memory at the end of the test case.

Awaiting for your reply

Thank you


Best Regards
Vijay
QA Engineer

9 Replies

  • Hi Vijay,

    Some answers:

    1) in your tearDown script you can access the testRunner.results array, which holds a TestStepResult object for each executed TestStep during the execution of the TestCase. This contains errors, request/response messages, etc.. Maybe you could use that as a basis for the information to write to your test mgmt tool?

    2) what if you select the "Discard OK Results" option in the TestCase options for the testcase? (Otherwise soapUI saves all sent and received attachments in memory for you to look at.. ) Also be sure to run the garbage collection (by right-clicking in the memory monitor and selecting Run GC) before you evaluate memory usage, since the JVM won't reclaim released memory until garbage collection is run (it runs automatically every 60 secds)

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Thank you for your reply. the idea you suggested really worked. but I cannot able get the log. info /error and soapUI.log.info/error messages which I used in the test cases (groovy script and script assertions in the request) if the those logs then my requirement if fulfilled.

    Thanks

    Regards
    Vijay
  • Hi Vijay,

    I'm not really sure what you mean here, what exactly are you not able to get as desired?

    regards,

    /Ole
    eviware.com
  • For example.
    if I have script assertion like below:-
    boolean bReq = false;
    def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
    def HolderResponse = groovyUtils.getXmlHolder( "GetMakeModelTree#Response" );
    def status = HolderResponse["//status"];

    if (status == "OK" || status == "NothingFound" )
    {
    bReq = true;
    log. info ("The request have status - " + status);
    }
    else
    {
    log. error ("The request have status - " + status);
    }

    assert bReq == true;

    in the above script testrunner.result has got only information about assert 'bReq' but I want have 'log. error ("The request have status - " + status) or log. info ("The request have status - " + status);' message in the test management tool and it would better if I can able to get the messages printed using soapUI.log.error or soapUI.log.info commands for a test

    please revert back

    Regards
    Vijay
  • Hello Vijay,

    The TestStepResult object contains many parameters of the request and response, but you cannot add additional information to it yourself, so you can't get the actual log messages that you are printing. You would have to recreate the log messages from the result data in the teardown script, just as you are currently doing in the script assertion. Through the TestStepResult object you should have access to all the data you need to do this. Alternatively you could store the log messages through some other method (basically creating the message, logging it, and also storing it for later use).

    Regards,
    Dain
    eviware.com
  • Hi Support team,
    Thanks for the reply.
    But i would like to go back to my previous problem, which is related to memory issue in the picture upload test. I have attached a small video of problem we are facing. Please revert back with your suggestion. The video is recored on the Soap UI GUI, normally we run the test in command prompt using test runner.

    Regards
    VJ
  • Hi!

    regarding the memory issue this is how it works: when soapUI starts the java runtime it is configured with a max memory setting (-Xmx????m) in the corresponding bar/vmoptions files; this is how much the JVM is allowed to use before running out of memory. The default settings are pretty high (1024?) which means that there is a lot of "space" not being used in most situations. It also means the JVM will not reclaim any left-over memory until the limit has been reached; in your case it seams the 5xx Mb of memory are still well be below the default limit and therefore the JVM won't try to purge or reuse it, event though it might not be used by soapUI. When the JVM runs out of memory it runs a process called "garbage collection" to try to reclaim memory that is no longer being used by the application, in the soapUI GUI you can trigger this manually by right-clicking in the memory-log and selecting "Run GC"; usually you will see a drop in memory which shows how much memory that was allocated by the JVM but not actually being used any more.

    In your case, it seems to me that the memory behavior is as expected; what would be interesting is to run the garbage collector after your tests to see how much of the allocated memory is actually being used; what if you run from inside the UI and select the "Run GC" option as mentioned above?

    Hope that makes sense! (and is correct :-)

    regards!

    /Ole
    eviware.com