Every month on the Third Tuesday as part of our How To…Series, we feature a new post with a guide on how to solve a particular problem with SOAP UI with guest blogger Brendan Connolly. This month he looks at request and response logging with Soap UI using Testrunner.
Browse previous posts in the How..To SOAP UI series
This month Brendan focuses on logging requests and responses being made with SOAP UI.
When testing interfaces via SOAP or REST it’s common to want to log the request and responses being sent. It could be to help troubleshoot failed tests or to act as documentation or reference point for comparing behaviour.
There are a variety of ways to accomplish this in SoapUI depending on desired results. Most involve using some Groovy scripting, and vary whether you are using the free or paid versions.
Before you dive into Groovy, take a look at a very simple option baked into SoapUI Test Runner Reports. After all why add more complexity to your tests if a out of the box option suits your needs.
To launch the Test Runner Right click on a TestSuite or TestCase.
The testRunner properties window will be shown.
Click on the Reports tab.
Check Exports all results (not only errors) and enter the destination folder where you would like you logs to be written.
Click the Launch button to execute your tests. When the tests are finished there will be a separate file for each request / response pair. The filenames will use the format TestSuiteName_TestCaseName_RequestTestStepName_Status.txt
If your test has multiple request and a failure occurs no further request steps will be logged.
You may need to close and reopen SoapUI after making changes to your tests and executing them from the test runner.