Forum Discussion

baruA's avatar
baruA
Occasional Contributor
11 years ago

Compare Results of Soap Response with JDBC Response

I am trying to Compare Results of Soap request with JDBC Request. I am trying achieve this with Xpath assertion in Soap Request but failed. Could you anybody help me in resolving this issue.

Declare was //*:CloseWebDrawerResult
Expected Result: //*:${JDBC Request#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]}

When I test the Assertion i am getting the error

XPathContains comparison failed, expecting [//*: 2013-09-19 12:34:43.0 20 2022 WS Test ], actual was [?xml version="1.0" encoding="utf-16"?> 2022 9/19/2013 12:34:43 PM 20 2022 WS Test ]

6 Replies

  • SiKing's avatar
    SiKing
    Community Expert
    I think you misunderstood the XPath assertion window.
    The Declare part takes an XPath expression. The Expected Result takes a string; so in your case, you want only
    ${JDBC Request#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]}
    without the leading "//*:".
    HTH
  • baruA's avatar
    baruA
    Occasional Contributor
    Thanks SiKing for clarifying it. Is there any other approach Does Soap Pro have to compare the Soap Response with Database other than Groovy scripting??
  • SiKing's avatar
    SiKing
    Community Expert
    The -Pro version has additional wizards to help you build up your expressions.
  • baruA's avatar
    baruA
    Occasional Contributor
    SiKing wrote:
    The -Pro version has additional wizards to help you build up your expressions.


    I am a newbie for Soap UI Pro. Could you please let me know what are the Wizards helpful?? Thanks for your prompt response.
  • SiKing's avatar
    SiKing
    Community Expert
    They are helpful if you do not know what you are doing. Once you get the hang of things you will hardly ever use them, as coding things by hand is much easier.
    The -Pro version has other features that are very useful for power-users. You will get there one day.