Contributions
- 520Views0likes0Comments
get the content of script and logged msgs to the file
Hi, during execution (testrunner) of tests, the status files are produced for all the steps in test case. For all test steps which are groovy scripts the following file content is produced - eg: file name: mysuite-mytestcase-myscript-0-OK.txt file content - see between START_OF_FILE and END_OF_FILE scripts: <START OF FILE> Status: OK Time Taken: 49 Size: 0 Timestamp: Tue Jul 10 10:55:08 CEST 2012 TestStep: My_Script ----------------- Messages ------------------------------ <END OF FILE> How to manipulate this file content to have here in this file all log messages the given script produces, and would be very good to get in this file the content of the given step too (the listing of given script itself) Pls advise...670Views0likes1Comment- 1.4KViews0likes0Comments
sorting properties
Hi, in soapui open source there is button for sorting properties (alphabetically). Can anyone share how to get the same behaviour via groovy script? I want to sort all the properties used in given test case (properties defined on test case level) alphabetically. The properties are in eg in transfers so I assume I can not just get properties map, sort it, delete all properties, and set them back from sorted map. This way all the transfers will be nulled... Yuor quick response is higlhy appreciated.2.1KViews0likes3Commentswhat is the issue with object accessability
HI, I did small library for suapui, and I am using that in my tests... But I can not understand the issue with object accessability in script functions... Can you answer, pls Ok let me articulate a question: why my object (xxx) is not visible in the functions, and the (tc) object is visible? my script (test step = script) in given soapui testcase looks like this: ========================================================= import my.lib.blabla.* //here is MyLibClass def tc=TestRunner.TestCase def xxx = new MyLibClass(1) def out = my_function(1,2) log.info out return def my_function(a,b) { def str1 = xxx.method1(a) def str2 = xxx.method2(b) def str3 = tc.getClass().getName() return str3 + " : " + str2 + " : " + str1 } =================================== as you can see I am trying to access xxx object in my_function(a,b) why I receive error here: :ERROR:An error occured [No such property: xxx for class: Script21], see error log for details707Views0likes0Comments- 721Views0likes0Comments
Re: NPE when calling REST service that returns a 204 response
Hi, anybody can answer? Is this bug fixed? I have the same issue, when using RunTestCase step (component)... in test scenarios. everything seems to go well if I run the scenario from gui... but using testrunner the logs shows: 13:41:35,219 ERROR [SoapUITestCaseRunner] Error saving failed result: java.lang.NullPointerException java.lang.NullPointerException at java.lang.String.<init>(String.java:593) at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:210) at com.eviware.soapui.tools.SoapUITestCaseRunner.afterStep(SoapUITestCaseRunner.java:695) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:244) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) 13:41:35,219 ERROR [SoapUITestCaseRunner] Error saving failed result: java.lang.NullPointerException java.lang.NullPointerException at java.lang.String.<init>(String.java:593) at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:210) at com.eviware.soapui.tools.SoapUITestCaseRunner.afterStep(SoapUITestCaseRunner.java:695) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:244) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)12 years agoPlace ReadyAPI QuestionsReadyAPI Questions656Views0likes0CommentsHow to convey context to my class
Hi, as we all know the following objects are available in sopui test run. testRunner context log I wrote a class where I want to use the objects, so defined a constructor MyClass(TestRunner tr, Context cn, Logger lg) { blablabla } but when I create object of MyClass then I receive error saying: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.pack.funny.MyClass(com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner, com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext, org.apache.log4j.Logger) The problematic is Context. What type is context? How to successfully pass the object to my class1.1KViews0likes2Comments