Forum Discussion

Progster's avatar
Progster
Occasional Contributor
13 years ago

Mock Service Problem

Hi,

I'm new in the Soapui world, as such I will try to explain my problem. I have a MockResponse that returns a response, so far so good. The problem is that I need to create an assertion that validates two parameters returned by the Mock response, for example, the first parameter: Name = AB and the second parameter: Number = 2. In the Form Mock I can fill in the values​​, but they are not saved in any teststep, as such I have no other place where to compare in order to create the assertion. Can anyone help me please?

Thanks in advance.

6 Replies

  • nmrao's avatar
    nmrao
    Community Hero
    Do not have much idea about Mock services.

    When you run the request, instead of getting response of from actual service provided, mock service will provide you the response, correct?
    Once you get the response, you can define assertions that you wanted to check. If that is xml response, you may add xpath assertion.
    For details, please refer to:
    http://www.soapui.org/Functional-Testing/xpath-and-xquery-assertions.html

    Hope this helps.

    Regards,
    Rao.
  • Progster's avatar
    Progster
    Occasional Contributor
    Hi,

    Thanks for responding. I get the XML response from the Mock Service, but when i trie to create the assertion, i can't or dont know how to get to the XML response, if i'm note mistaken i just access the request, and i dont know how to access the response XML of the Mock, also the value that i fill in the Mock form are not saved in any teststep, and this is my second problem to the creation of the assertion.
  • nmrao's avatar
    nmrao
    Community Hero
    When the request is tested against mock service, you would see the response, there you can add your assertions, for details refer to the link provide in earlier response.

    Hope this helps.
  • Progster's avatar
    Progster
    Occasional Contributor
    Yes, I can see the Mock XML response. The problem is when i press the button on the left of the word "Declare", I can't see the elements of the Mock Response, and that is why i cant create the assertion.
  • Progster's avatar
    Progster
    Occasional Contributor
    Problem Solved.

    In the Mock like i said, i saw the XML response, what i didn't saw was the rest of the XML code . After it was just a matter of creating the assertions.
  • nmrao's avatar
    nmrao
    Community Hero
    Yes, you are there. Anything one does not know is lika monster, once some time spend with it understand it, then it will be in your finger tips.