Folks, in this post i will be covering the use of
test runner - by which you can execute your soapUI projects (from command line) without opening soapUI application.
This feature will by very useful when you want to perform the regression test on the newly deployed code & to store the response data in some files. And execution can be done by anyone (including people who don't know "how to use soapUI").
testrunner.bat (soapui_install_dir/bin folder) is a command line utility which is getting called whenever we execute our testcases with some predefined (or userdefined) conditions. In soapUI application, right click on any selected testcase/test suite and then select "launch test runner" from the context menu to call the test runner.bat file. This will open a new window wherein you can provide the required configuration data like, testcase/testsuite to be executed, endpoint url, folder to store the response, ignore the error results and so on.
After providing all the details, start the testrunner.bat by clicking launch button. In the window it will display the command line arguments being passed for the selected combination of input data.
Similarly, you can directly call the testrunner.bat from the command line utitlity and provide those parameters to perform the test execution. This will save lot of time to perform the test execution and also it can be executed by anyone (in your absence).
I have created a simple batch file (my_soapUI.bat) to perform this set of activity. So to perform the regression test, i need to just execute the "my_soapUI.bat" file from the command line and rest would be taken care.
cd C:\Program Files\eviware\soapUI-Pro-3.6\bin
testrunner.bat -ehttp://127.0.0.1/soapUI/Service.svc -sLoad_Test_Apr2011_TestSuite -r -a -fD:\Automate\store_response -I "C:\Documents and Settings\pradeep.bishnoi\My Documents\my_soapui-project.xml"
:: To override the endpoint for the teststeps use
:: -e(Endpoint URL)
:: -ehttp://x.x.x.x/WebService.svc
:: TestSuite to run, used to narrow down the tests to run
:: -s(TestSuite Name under the project)
:: -sTestSuiteSoapUI
:: TestCase to run, used to narrow down the tests to run
:: -c(TestCase Name under the project/testSuite)
:: -cTestCaseSoapUI
:: r : Turns on printing of a small summary report. To be used when you want to save generated reports
:: -r
:: f : Specifies the root folder to which test results should be exported
:: -f(Complete path of the folder where to save the response)
:: -fD:\soapUI\responseReport
:: a : Turns on exporting of all test results, not only errors. To be used when you want to export both passed and failed test step reports
:: -a
:: I : Do not stop if error occurs, ignore them. Execution will continue even when any test step fails/error comes.
:: -I
:: After providing all the parameters, pass the complete soapUI project file location in double quotes "" which contains the above mentioned testSuite & testCases for execution.
:: example "C:\soapui-project.xml"
To use the same, just copy the code lines (in yellow colored font) and save them into a "my_soapUI.bat" file and edit the required parameters like endpoint, project file name, and folder to store the response etc.
EndNote : Biggest advantage of using the command line approach is #Faster execution since we are directly executing the project without opening the soapUI.