TestCase Debugging

NOTE: This guide contains information on standalone ReadyAPI that has been replaced with ReadyAPI. To try test debugging, feel free to download a ReadyAPI trial from our web site.

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 ReadyAPIperties.

Getting started

This guide will show you how to get started with TestCase Debugging.

  1. 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 ReadyAPI installer.

    ImportProject

     
  2. Start the SampleServiceSoapBinding MockService by right clicking it and selecting Start Minimized.

    StartMinimized

     
  3. Then open the Sample Simple TestSuite and the Simple Search TestCase.

    SelectTestCase

     
  4. Now click on the TestCase debugging tab to open up the TestCase Debugging panel.

    TestCaseDebuggingTab

     
  5. 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.

    AddBreakpoint

     
  6. Run the test to the breakpoint by clicking the green arrow to the left.

    RunToBreakpoint

     
  7. 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.

    ExecutionMarker

     
  8. To the right of the TestStep execution list there’s list of of all ReadyAPIperties 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.

    ChangedProperties

     
  9. 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.

    TestRequestLoginExpanded

     
  10. Down in the bottom corner there’s an inspector which shows the content of Request property in a more readable format.

    LoginInspector2


Conditional breakpoints

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.

  1. Start by right clicking the breakpoint and select Breakpoint properties.

    BreakpointPropertiesMenu

     
  2. Now check the Conditional checkbox to add a condition to your breakpoint.

    CheckConditional

     
  3. 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.

    ConditionalBreakpointExpression