cancel
Showing results for 
Search instead for 
Did you mean: 

test suite startup script not executed from command line

Contributor

test suite startup script not executed from command line

For debugging, I added log statements to the test case and test suite start up scripts:

log.info "i can has test suite setup?"

And
log.info "i can has test case setup?"


Here is my test runner command:

testrunner.sh -sts_ingestTestCases -S -cROGS-1003-VALIDATION -r -f 1387309643 -j  -Ptitle=ROGS-1003-212773 file:/blah/blah/project/path/blah.xml


Based on test runner log, test suite setup script is not executed:

=================================
=
= SOAPUI_HOME = C:\cygwin\SOAPUI~1.0
=
================================
soapUI Pro 4.0.2-SNAPSHOT TestCase Runner
14:47:28,274 WARN [SoapUI] Missing folder [C:\soapui-pro-4.0\bin\ext] for external libraries
14:47:28,867 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\ederber\soapui-settings.xml]
14:47:29,418 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\PROGRA~1\SMARTB~1\SOAPUI~1.1\bin\scripts]
14:47:30,693 INFO [WsdlProject] Loaded project from [file:/C://blah/blah/project/path/blah.xml]
14:47:31,302 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\PROGRA~1\SMARTB~1\SOAPUI~1.1\bin\scripts]
14:47:32,313 INFO [SoapUIProTestCaseRunner] Setting project property [title] to [ROGS-1003-212773]
14:47:32,335 INFO [SoapUIProTestCaseRunner] Running soapUI tests in project [blah]
14:47:32,335 INFO [SoapUIProTestCaseRunner] Running TestCase [ROGS-1003-VALIDATION]
14:47:33,235 INFO [log] i can has test case setup?
14:47:33,290 INFO [SoapUIProTestCaseRunner] Running soapUI testcase [ROGS-1003-VALIDATION]
14:47:33,292 INFO [SoapUIProTestCaseRunner] running step [ROGS-1003-VALIDATION]
14:47:56,025 INFO [SoapUIProTestCaseRunner] Finished running soapUI testcase [ROGS-1003-VALIDATION], time taken: 22697ms, status: FINISHED
14:47:56,026 INFO [SoapUIProTestCaseRunner] TestCase [ROGS-1003-VALIDATION] finished with status [FINISHED] in 22697ms


Where is the issue? Is test runner not getting at the test suite at all?
7 REPLIES

Re: test suite startup script not executed from command line

Hi,

The command line argument you are using is an uppercase S, it should be a lowercase s to run the testsuite.
Here is a link for the command line arguments for testrunner.bat\.sh.

http://www.soapui.org/Test-Automation/f ... tests.html



Regards,
Marcus
SmartBear Support

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

Re: test suite startup script not executed from command line

I have both lower case (s) and upper case (S) in the command.

The upper case is there to save the project file after execution.

Lower case does set the test suite:

-sts_ingestTestCases

Re: test suite startup script not executed from command line

Hi,

You need to put a space after -s to list the test suite name.
-s ts_ingestTestCases




Regards,
Marcus
SmartBear Support

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

Re: test suite startup script not executed from command line

Thanks for your replies, Marcus.

Regrettably, the test suite setup script is not executing.

The script does run if I execute test suite from the UI.

Here is last testrunner log:

$ /soapui-pro-4.0/bin//testrunner.sh -s ts_ingestTestCases -S -cROGS-1003-VALIDATION -r -f 1387317890 -j  -Ptitle=ROGS-1003-803348 file:/C://blah/path/blah/path/blah/path/blah.xml
/soapui-pro-4.0/bin
================================
=
= SOAPUI_HOME = C:\cygwin\SOAPUI~1.0
=
================================
soapUI Pro 4.0.2-SNAPSHOT TestCase Runner
17:09:43,734 WARN [SoapUI] Missing folder [C:\soapui-pro-4.0\bin\ext] for external libraries
17:09:44,669 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\ederber\soapui-settings.xml]
17:09:45,259 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\PROGRA~1\SMARTB~1\SOAPUI~1.1\bin\scripts]
17:09:46,501 INFO [SoapUI] File
17:09:46,620 INFO [WsdlProject] Loaded project from [file:/C:/cygwin//testing/rogers/labdrop3/automation/soapui_projects/Rogers_LD3.xml]
17:09:47,238 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\PROGRA~1\SMARTB~1\SOAPUI~1.1\bin\scripts]
17:09:48,183 INFO [SoapUIProTestCaseRunner] Setting project property [title] to [ROGS-1003-803348]
17:09:48,198 INFO [SoapUIProTestCaseRunner] Running soapUI tests in project [Rogers_cms]
17:09:48,198 INFO [SoapUIProTestCaseRunner] Running TestCase [ROGS-1003-VALIDATION]
17:09:49,033 INFO [log] i can has test case setup?
17:09:49,034 INFO [SoapUIProTestCaseRunner] Running soapUI testcase [ROGS-1003-VALIDATION]
17:09:49,121 INFO [SoapUIProTestCaseRunner] running step [ROGS-1003-VALIDATION]
17:09:53,264 INFO [SoapUIProTestCaseRunner] Finished running soapUI testcase [ROGS-1003-VALIDATION], time taken: 4120ms, status: FINISHED
17:09:53,274 INFO [SoapUIProTestCaseRunner] TestCase [ROGS-1003-VALIDATION] finished with status [FINISHED] in 4120ms

SoapUI 4.0.2-SNAPSHOT TestCaseRunner Summary
-----------------------------
Time Taken: 5076ms
Total TestSuites: 0
Total TestCases: 1 (0 failed)
Total TestSteps: 1
Total Request Assertions: 0
Total Failed Assertions: 0
Total Exported Results: 0

Re: test suite startup script not executed from command line

Hi,

Try removing the -c option since that is to run an individual test case. Also, when using any of the testrunner options please put a space in between the option and value.

I tried one of my test cases from cmd line and ran test suite with code in Setup Script and it worked.

C:\Program Files\SmartBear\SoapUI-4.6.2\bin>testrunner "C:\SoapUI\SOAPUI Projec
s\SOAP-Attachement-MIME-soapui-project.xml" -s "MimeAttachmentSOAP TestSuite"

SoapUI 4.6.2 TestCase Runner
Configuring log4j from [C:\Program Files\SmartBear\SoapUI-4.6.2\bin\soapui-log4j
.xml]
17:33:20,019 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\User
s\Marcus.James\soapui-settings.xml]
17:33:20,569 INFO [WsdlProject] Loaded project from [file:/C:/SoapUI/SOAPUI%20P
rojects/SOAP-Attachement-MIME-soapui-project.xml]
17:33:20,969 INFO [SoapUITestCaseRunner] Running SoapUI tests in project [SOAP
Attachement MIME]
17:33:20,969 INFO [SoapUITestCaseRunner] Running TestSuite [MimeAttachmentSOAP
TestSuite], runType = SEQUENTIAL
17:33:21,209 INFO [log] failing test suite
17:33:21,219 INFO [SoapUITestCaseRunner] TestSuite [MimeAttachmentSOAP TestSuit
e] finished with status [FAILED] in 250ms

Regards,
Marcus
SmartBear Support

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Contributor

Re: test suite startup script not executed from command line

OK, so by removing the test case (c) switch the test suite setup script is now executed.

So, test suite setup scripts will not be executed if test case (c) switch is set, then.

Is there no mention of this limitation in SoapUI documentation? Is this a known issue? Could this be fixed?

Re: test suite startup script not executed from command line

This is not necessarily a limitation. If you want to run individual test case in a test suite then you would use the -c option and list the test case. The code needed for that test case can be in the test case setup, on, and tear down script section. The test suite option is to run the test suite itself and all the containing test cases in that test suite. Why do you need in particular to run the test suite scripts if you just want to run a test case? We also have event handlers as well that are at the test case and test suite level.

http://www.soapui.org/Scripting-Propert ... dlers.html


Regards,
Marcus
SmartBear Support

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Watch a new Video
Top Kudoed Authors