In this guide you'll learn how to add TestCase Debugging to a TestCase, and run the test. This feature is only available in soapUI Pro, so you should download soapUI Pro Trial before starting, if you don't have it.
As in software development, there are times when you want to examine the behavior of your tests in detail using so called debugging. This is very useful when you suspect errors in your tests or the services that you are testing. The TestCase debugging feature provides the possibility to add breakpoints to a TestStep, run to that breakpoint and then view the current values of the soapUI properties.
This guide will show you how to get started with TestCase Debugging.
- Import the sample-soapui-pro-project.xml project found in the soapUI-Tutorials folder in your home folder. If you don’t see the soapUI-Tutorials folder, please make sure that you checked the Tutorials option in the soapUI Pro installer.
- Start the SampleServiceSoapBinding MockService by right clicking it and selecting Start Minimized.
- Then open the Sample Simple TestSuite and the Simple Search TestCase.
- Now click on the TestCase debugging tab to open up the TestCase Debugging panel.
- Now click the BP column to the left of the Property Transfer: Move sessionID TestStep. This will add a breakpoint to your TestCase which will halt the execution before the selected TestStep is being executed.
- Run the test to the breakpoint by clicking the green arrow to the left.
- The TestCase will run to the breakpoint. The green arrow in the rightmost column indicates the TestStep to be executed, in this case the Property Transfer: Move sessionID.
- To the right of the TestStep execution list there’s list of of all soapUI properties grouped by type. If there has been a change of a property value, the heading of its group will be marked with an asterix indicating that it has been changed. In our case the Context and the Test Request:login has been changed.
- If we click on the plus sign on the Test Request:login group it will expand and we’ll see that the RawRequest, Request and Respons has changed.
- Down in the bottom corner there’s an inspector which shows the content of Request property in a more readable format.
Sometimes you may want to break at a TestStep only if a certain condition is valid. This guide will show you how to add a condition to your breakpoint.
- Start by right clicking the breakpoint and select Breakpoint properties.
- Now check the Conditional checkbox to add a condition to your breakpoint.
- Finally write a condition in Groovy that will either resolve in true or false.
In this case the breakpoint will be enabled if there is a TestCase property called myProperty that has the value myValue. You can also test this condition by clicking the green arrow button.
Try soapUI Pro for free!
TestCase Debugging is a soapUI Pro specific feature. By going Pro you get everything thats in soapUI plus a bunch of productivity and time-saving enhancements. Download our 2-week free trial and try them out for yourself!