|
Title: Test case log Post by: Keacey on March 10, 2008, 06:47:19 pm Hi,
I am new to SoapUI. When running a test case, and at the end of it, there is the test case log info which is displayed at the lower part of the test case dialog. how can i access this info as text? and is there any way that i can export this info to an external file like .txt or .doc? thanks in advance. Title: Re: Test case log Post by: omatzura on March 10, 2008, 07:44:16 pm Hi!
There is an "Export to file..." button in the toolbar just on top of the log, this will create a txt file of the log contents. Other options are to create a TearDown groovy script that accesses the results for all TestSteps and writes a custom log-file in any way you want.. Hope this helps! regards, /Ole eviware.com Title: Re: Test case log Post by: Keacey on March 11, 2008, 11:12:00 am Hi,
I have entered this below code in the test case teardown script. def testcase = testRunner.getTestCase() def steplist = testcase.getTestStepList() def a = steplist[0] def b = new com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStepResult(a) def c = b.getMessages() def tclog = new File ("c:\\groovy\\testcaselog.txt") tclog << c In my variable c (and my .txt file) i get {} (two flowery brackets). but no messages. According to me, i have to get the test case log , something like - Test started at 2008-03-11 15:23:40.488 Step 1 [Request 1] OK: took 11578 ms TestCase finished with status [FINISHED], time taken = 11578 in my variable c. Is my code correct? If not what should i enter in the teardown script to get the above information. I do not want to use the button to export to file, but i want the same action in groovy. Please help. Kusuma. Title: Re: Test case log Post by: Keacey on March 12, 2008, 08:32:03 am Hi,
Could you please tell me from where can i access the teststep results? Please help. Kusuma. Title: Re: Test case log Post by: omatzura on March 12, 2008, 12:57:46 pm Hi!
you can get all the results for a TestCase run with def results = testRunner.results which returns a list of TestStepResult objects.. have a look at the javadocs at http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/testcase/WsdlTestCaseRunner.html to dig deeper.. regards! /Ole eviware.com Title: Re: Test case log Post by: Keacey on March 13, 2008, 09:06:40 am Hi Ole,
Thanks for the help. Now i am able to get results. But i have a new problem now. I am using this code to get the test step results. Code: def results = testRunner.getResults() but sometimes when i run the test case, i get a null value for "results". The steps look correct, but no results are generated. Could you please tell me what could be the problem for this, and how can i ensure that i always get values in my "results" variable. Please help. Kusuma. Title: Re: Test case log Post by: omatzura on March 13, 2008, 02:09:55 pm Hi!
Could you please make sure that you do not have the "Discard OK Results" option checked in the TestCase Options dialog? Let me know.. regards, /Ole eviware.com Title: Re: Test case log Post by: ahsu on April 22, 2008, 12:48:01 pm This forum is really good and too informative.
just i have one question: Is Groovy has to be down loaded for executing the code which you have placed in the Tear down script?? Bcoz the same is not working for us with out the Groovy software. Thanks in advance Title: Re: Test case log Post by: omatzura on April 22, 2008, 01:01:40 pm Hi!
it should work out of the box.. are you getting any errors or exceptions? regards, /Ole eviware.com Title: Re: Test case log Post by: ahsu on April 22, 2008, 02:11:57 pm we are not getting any errors but we are getting the flower braces.
No content is there with in the braces. Title: Re: Test case log Post by: omatzura on April 22, 2008, 02:58:26 pm Hi,
sorry.. I'm not really sure when/how you are getting this.. can you give some details and/or attach a screenshot? regards! /Ole eviware.com |