Forum Discussion

PeterKlim's avatar
PeterKlim
Contributor
12 years ago

Assertion for Load Test

In SoapUI Pro, I created a test that I am using as a load test. I have it set up so that the DataSource is a "Directory". In that directory, I have a number of XML files. Each XML is used as a request. I created an assertion to look for a string anywhere in the response. I tested it for a single request by clicking the green run button in the "HTTP Test Request" - it works. I changed the string to see if it fails - it does. So now I know it will catch failures too. I set it back to the correct string. Before the assertion, I ran the load test to do multiple requests and got no failures. But after adding the assertion, I get failures. My co-worker is telling me assertions in SoapUI Pro are only usuable when running as a functional test, not as a Load Test. Is this true? Or do I need to do something else to get it to work?

3 Replies

  • That is correct, When running a load test you will only be running the test step and not any assertions tied to it. Is there something specific that you are trying to accomplish? Please let me know to see if we can assist.

    Regards,
    Temil
  • Hi Temil,

    Thanks for replying.

    At the very end of this post is part of an XML response I received. Using it as an example, I may want to verify the following string is found for every response returned during the load test run:

    "STATUS _Condition="SUCCESSFUL"

    You can see the above string is found, but so is additional information in there that is not desireable. But for now I would like to verify this string is found... small baby steps at a time

    My load test can have anywhere from 6,500 to 65,000 Request XMLs submitted and we would like to have a count of how many of them do not find the above string in the XML Response.

    <RESPONSE_DATA>
    <PROPERTY_INFORMATION_RESPONSE>
    <STATUS _Condition="FAILURE" _Code="0297" _Description="CURRENTLY OUR SYSTEM HAS LIMITED ACCESS, PLEASE TRY AGAIN LATTER."/>
    <_PRODUCT _DetailedComparableReport="Y">
    <STATUS _Condition="SUCCESSFUL" _Code="0500" _Description="REPORT RETURNED SUCCESSFULLY. NO ERRORS ENCOUNTERED."/>
    </_PRODUCT>
    </PROPERTY_INFORMATION_RESPONSE>
    </RESPONSE_DATA>
  • Hello Peter,

    Seem like I was wrong about he "assertions not being relevant in load testing." The truth is that it Does effect the load test, but you can only see it when the assertion fails. I suggest you use a "Not contains" assertion on the steps and add "STATUS _Condition="SUCCESSFUL." This way you will receive a message in the load test area for each response that contains "STATUS _Condition="SUCCESSFUL." Let me know if you have further questions

    Regards,
    Temil