cancel
Showing results for 
Search instead for 
Did you mean: 

do tear down scripts work when testrunner is run on the command line?

Highlighted
New Contributor

do tear down scripts work when testrunner is run on the command line?

I have reports that are being generated in the teardown scripts of my test suite and the test cases. The reports are generated if I launch Test Runner from Soap UI or if I run it manually. I have tried to run it with -aifR and still nothing any ideas?

 

This is the tear down script for my testcases 

2015-12-23_1113.png 

6 REPLIES 6
Highlighted
Community Hero

Re: do tear down scripts work when testrunner is run on the command line?

There is no testRunner variable available in TestSuite's teardown script. Only runner, context, testSuite, log vairables are available.
You should be able to find them on the top of tear down script editor.


Regards,
Rao.
Highlighted
Community Hero

Re: do tear down scripts work when testrunner is run on the command line?

Also please have a look at http://www.soapui.org/reporting/generating-html-reports.html - regarding reports.


Regards,
Rao.
Highlighted
New Contributor

Re: do tear down scripts work when testrunner is run on the command line?

Sorry this code is for what is in the test cases. The code works. I would just like to know why it does not work when  I run the project on the command line

 

Highlighted
Community Hero

Re: do tear down scripts work when testrunner is run on the command line?

Can you please provide more details:

 

  • what are you trying to achieve?
  • what are steps in your test case?
  • the command that you are using from command  line?
  • did not get, "it does not work"? deails will help including logs.


Regards,
Rao.
Highlighted
New Contributor

Re: do tear down scripts work when testrunner is run on the command line?

This is my log. It either cannot find the file that is created or the file is not cxreated so nothing is stored. what should I change?

 

11:39:40,053 ERROR [SoapUI] An error occurred [C:\Documents\SOPAUI\
Response_Login TestCase_0_4_113939.txt (The system cannot find the path specifie
d)], see error log for details
java.io.FileNotFoundException: C:\Documents\SOPAUI\Response_Login T
estCase_0_4_113939.txt (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileWriter.<init>(Unknown Source)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.newWriter(ResourceG
roovyMethods.java:1617)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.append(ResourceGroo
vyMethods.java:827)
at org.codehaus.groovy.runtime.dgm$749.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMetho
dSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMeta
MethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSi
teArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:116)
at Script1$_run_closure1.doCall(Script1.groovy:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(C
losureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
at groovy.lang.Closure.call(Closure.java:411)
at groovy.lang.Closure.call(Closure.java:427)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMe
thods.java:1325)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMe
thods.java:1297)
at org.codehaus.groovy.runtime.dgm$148.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMetho
dSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMeta
MethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSi
teArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:116)
at Script1.run(Script1.groovy:12)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.
run(SoapUIGroovyScriptEngine.java:92)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.runTearDownScript(
WsdlTestCase.java:898)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTearDo
wnScripts(AbstractTestCaseRunner.java:186)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalF
inally(AbstractTestCaseRunner.java:171)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalF
inally(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractT
estRunner.java:150)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

 

Highlighted
Community Hero

Re: do tear down scripts work when testrunner is run on the command line?

Really sorry, it is difficult to comment with available information. Did you go thru earlier reply?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Read the Latest News
JuneSCNJ
Top Kudoed Authors