Forum Discussion

JesB's avatar
JesB
New Contributor
9 years ago

Validate the response from the RESTAPI request against the response from the JDBC step

I am new to SOAPUI. I need help to validate in other words groovy script to assert the response from the REST API request against the response from the JDBC step. Could someone help me with this?

 

 

  • JesB's avatar
    JesB
    New Contributor

    Thank you! but, does it mean that I should have separate groovy step or the groovy assertion in the JDBC and REST API step. And, in the link you shared, I did not understand how the response from each step is retrieved.

     

    My REST API response is in XML:

     

     <himUser updatedDate="2016-05-25T08:19:42Z" specialty="Nephrology" siteName="Westside - L - 03" siteId="8" login="AKSi79i" speakerCode="BJAi79i">
          <address state="Karnataka" zipCode="560078" country="India" city="Bangalore" street1="Magrath Road"/>
          <contact phoneNumber="9709606"/>
          <person prefix="Dr." middleName="J1" lastName="spkr123" firstName="Syn123"/>
       </himUser>
    </himUsers>

     

     

    And, the JDBC response is like:

     

      <Row rowNumber="7">
                <SPEAKERCODE>BJAi79i</SPEAKERCODE>
                <LOGIN>AKSi79i </LOGIN>
                <UPDATEDDATE>2016-05-25 04:19:42.603</UPDATEDDATE>
                <BUSINESSENTITYID>8</BUSINESSENTITYID>
                <SHORTNAME>Westside - L - 03 </SHORTNAME>
                <DESCRIPTION>Nephrology</DESCRIPTION>
                <STREET1>Magrath Road</STREET1>
                <STREET2/>
                <CITY>Bangalore</CITY>
                <COUNTRY>India </COUNTRY>
                <ZIP>560078  </ZIP>
                <STATE>Karnataka</STATE>
                <FIRSTNAME>Syn123</FIRSTNAME>
                <LASTNAME>spkr123 </LASTNAME>
                <MIDDLEINITIAL>J1</MIDDLEINITIAL>
                <SUFFIX/>
                <PREFIX>Dr.</PREFIX>
                <EMAILADDRESS/>
                <PHONE>9709606</PHONE>
            </Row>

     

     

    • nmrao's avatar
      nmrao
      Champion Level 3
      Can you provide input what is not cleared in the link provided. It clearly says the steps used including its type. Yes, it is a groovy step, what is confusion?

      As told earlier, you need to create the model according to your suite. What I gave you will address to that specific issue. But you can make changes as you required. Then compare.