Forum Discussion

jkrier's avatar
jkrier
Regular Contributor
11 years ago

Cloning assertions will fail when the response is different

I have a service with several methods that use different inputs to return the same data; example getAccountInfoByAccount, getAccountInfoByPhoneNumber, getAccountInfoByName etc.

The response is always the same regardless of which method is used. I want to assert the response message structure (account/customer/services) and I am using the existence assertion to do this. When you clone the assertion from getAccountInfoByAccount to getAccountInfoByPhoneNumber the assertion fails because the name of the response does not match (getAccountInfoByAccountResponse versus getAccountInfoByPhoneNumberResponse). This makes the cloning feature useless because, in order to make this work you still need to edit each assertion one by one for the correct response name.

Is there another way to clone assertions so that they are functionable? I tried looking here http://www.soapui.org/functional-testing/validating-messages/getting-started-with-assertions.html and here http://www.soapui.org/functional-testing/assertion-teststep.html#4-Other-Assertion-Features but neither page had information on my question. The second URL references another page http://www.soapui.org/Assertions/clone-assertions.html but this returns 404

6 Replies

  • nmrao's avatar
    nmrao
    Community Hero
    How you are creating the assertion, a screen would help better understand of your scenario. Clone functionality is to have the same thing which has been done/created earlier and wanted the same stuff somewhere else. Not sure if you understanding is same in this regard.
  • jkrier's avatar
    jkrier
    Regular Contributor
    I understand that. What I wish SoapUI was capable of doing was to know what namespace it was declaring. That is where the issue lies. If you clone an assertions for 'Check for existence' from one call to another it will fail because the name of the request is different regardless of the response is an exact match across methods.

    The attachment is meant to show the issue. Two different requests that return the same response. In this case a node named account. Their XSD is the same in this regard. So for example, in the first request getAccountByPhone. If I add a 'check for existence of account' by selecting a node in the Outline tab, right clicking 'for existence' it will add the assertion. Then in the assertion tab I click "Clone an arbitrary number of Assertions from this TestStep to other TestSteps" it will clone the assertion with the same declared namespace. When the TestStep is ran that includes this cloned assertion it will fail because the namespace declared does not match the operation. This requires the user to go through each request that is trying to use a cloned assertion and manually declare the namespace. If the user has to do this than there is no point in using the cloned assertion function to begin with.
  • nmrao's avatar
    nmrao
    Community Hero
    Let me understand one basic here. Are you talking about Test Request step's assertion cloning? or Assertion Test Step cloning?
    • jkrier's avatar
      jkrier
      Regular Contributor

      Test Request step's assertion cloning. I am cloning assertions from one test step to another.

      • nmrao's avatar
        nmrao
        Community Hero

        If that is the case, I am wondering how are you cloning assertions of one step to another Test Request type, which is invalid usage. Valid usage IMO, cloning of assertion for  the same Test Request type, and want to change/assert different element where it has the same namespaces.