Forum Discussion

phanisrikar's avatar
phanisrikar
Contributor
13 years ago

Loadui -If time taken for a step is 0, fails the test case ?

Hi,

We are testing the REST services, with 5 step involved

1. create
2. read
3. update
4. read
5. delete

when I conduct load test for the above test case, delete step is failing from the loadui, but it actually performs the intended delete operation, but it shows as test case failed and the failed count increases.

I have attached the snapshot of the table log having the time taken for each step. I suspecting just because of the time taken to perform the delete operation is negligible is it failing the delete test step and test case ?

also as we are testing the REST services, the response is in json format which is not getting converted to xml format to insert any king of check points however I have inserted the script checkpoint, but why it is not converting as xml ? attached the json response file. I have tried the solution posted below

viewtopic.php?f=5&t=4201&p=30723&hilit=JSON+response#p30723

Need help

Thanks
Phani

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Yesterday I finished my complete rewrite of the soapUI Integration section of our documentation. From there, I would specifically recommend reading Debugging failures.

    The new soapUI Runner in loadUI 2.0 beta 1 will probably also help you debug this.

    Hope this helps!

    Henrik
    SmartBear Software
  • I have checked the soapui-error log in the given directory, below was the error

    2012-03-12 07:49:42,595 ERROR [errorlog] java.lang.IllegalArgumentException: wrapped entity must not be null
    java.lang.IllegalArgumentException: wrapped entity must not be null
    at org.apache.http.entity.HttpEntityWrapper.<init>(HttpEntityWrapper.java:61)
    at org.apache.http.entity.BufferedHttpEntity.<init>(BufferedHttpEntity.java:58)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpMethodSupport.getResponseBody(HttpMethodSupport.java:269)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.support.methods.ExtendedDeleteMethod.getResponseBody(ExtendedDeleteMethod.java:174)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.BaseHttpResponse.<init>(BaseHttpResponse.java:89)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.SinglePartHttpResponse.<init>(SinglePartHttpResponse.java:42)
    at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.httpRequest(HttpPackagingResponseFilter.java:85)
    at com.eviware.soapui.impl.wsdl.submit.filters.HttpPackagingResponseFilter.afterAbstractHttpResponse(HttpPackagingResponseFilter.java:50)
    at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.afterRequest(AbstractRequestFilter.java:64)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:300)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
    at com.eviware.soapui.impl.rest.RestRequest.submit(RestRequest.java:209)
    at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.run(RestTestRequestStep.java:898)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:238)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:147)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
    at com.eviware.loadui.components.soapui.SoapUISamplerComponent$SoapUITestCaseRunner.run(SoapUISamplerComponent.java:1148)
    at com.eviware.loadui.components.soapui.SoapUISamplerComponent.sample(SoapUISamplerComponent.java:978)
    at com.eviware.loadui.impl.component.categories.RunnerBase.doSample(RunnerBase.java:519)
    at com.eviware.loadui.impl.component.categories.RunnerBase.access$700(RunnerBase.java:72)
    at com.eviware.loadui.impl.component.categories.RunnerBase$Worker.run(RunnerBase.java:803)
    at com.eviware.loadui.util.dispatch.CustomThreadPoolExecutor$Worker.run(CustomThreadPoolExecutor.java:197)
    at java.lang.Thread.run(Unknown Source)

    Since the delete operation step has nothing to return, it is given the error ?

    Thanks,
    Phani
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    phanisrikar wrote:
    Since the delete operation step has nothing to return, it is given the error ?

    I should have asked this before, but what happens if you run it in soapUI?

    Henrik
    SmartBear Software
  • If I execute from soapui it is working fine, even I have an assertion added to verify the null response.

    assert messageExchange.responseContent.equals(null)

    And load test from soapui also fails at the last step and increases the error count. But the actual delete operation is performed successfully.
    Please verify the screenshot attached.

    Thanks
    Phani
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    The script assertion you have can never be successful, it will either be false or thrown an exception. There are two possible outcomes:

    responseContent IS NOT null, causing the assertion to fail.

    responseContent IS null, causing a NullPointerException when it is being dereferenced to make the equality check, which will prevent the assertion from even being made.

    I don't believe that soapUI will ever return a null value for responseContent, so the exception case may never occur (though I'm not entirely sure about that). What I think you mean to check against is an empty response, I.E. an empty String OR a null value. Doing this in Groovy is quite easy, as Groovy will automatically convert such a value into false when used as a boolean expression. Try changing the assertion to this:


    assert ! messageExchange.responseContent


    Regards,
    Dain
    SmartBear Software