Forum Discussion

ME_Bank_Support's avatar
ME_Bank_Support
Occasional Contributor
11 years ago

Default Response Comparison.

One of our third party vendor keep on changing the WSDL's with out informing us so we decided to compare the WSDL's between their DEv and out SIT env every day to know whether any change in the WSDL structure or now. I created a project load the required WSDL comparing the Default Request by using a Groovy script. I dont want to fire a request because many fields in the response or optional and Soap UI will only show the required. So i need to compare the default Response with out firring a request. I am just capturing the Default request successfully and can be able to compare by using the below groovy script.
def requestDev = context.expand( '${GetPartyInformation - Dev#Request}' )
def requestJEnv = context.expand( '${GetPartyInformation - JEnv#Request}' )
if (requestDev == requestJEnv )
{
testRunner.testCase.getTestStepByName("GetPartyInformation - JEnv").setPropertyValue( "Username", "XSD Match" )
}
else
{
testRunner.testCase.getTestStepByName("GetPartyInformation - JEnv").setPropertyValue( "Username", "XSD Mismatch" )
}

I tried the same way to capture the response as well but no luck. Can you please advice how to capture default response for an operation and compare against two env.
  • Hi,

    When I right click in the Groovy test step and select response, a dialog pops up asking me do I want to use default values. If I select yes, then from there I can select based off the xpath editor, are you seeing the same thing?


    Regards,
    Marcus
    SmartBear Support
  • ME_Bank_Support's avatar
    ME_Bank_Support
    Occasional Contributor
    Yes I do. After getting the pop up i am saving the default response in a variable as shown below.

    def responseDev = context.expand( '${BSBCode - Dev#Response}' )

    but when you want to display it it displaying blank.

    def responseDev = context.expand( '${BSBCode - Dev#Response}' )

    see the attached snapshot
  • Hi,

    You should use the MockResponse test step instead. Create a MockResponse test step and right click Get Data -> MockResponse test step -> response.



    Regards,
    Marcus
    SmartBear Support
  • ME_Bank_Support's avatar
    ME_Bank_Support
    Occasional Contributor
    Thanks Markus. it worked but still didn't solve the issue. i created the mock response in the test suit and loaded the default response from the schema. Is there a way to load it dynamically from the schema every time i run the test suite. Because if the dev has changed the schema and didn't let us know we need to run the suit and find out the difference. but now if we run it loads once and compares the same when ever we run but what we need is it need to load the response from the schema every time we run the suit.
  • Hi,

    One option is to create the MockResponse test step dynamically using Groovy, but the following from the first post you made

    I dont want to fire a request because many fields in the response or optional and Soap UI will only show the required.


    SoapUI Pro can show all the elements in the response whether they are required or optional. Do you want only the required elements?


    Regards,
    Marcus
    SmartBear Support
  • ME_Bank_Support's avatar
    ME_Bank_Support
    Occasional Contributor
    We want it to show all the fields including all the optional. Can you be able to give a sample Groovy script that fires the MockResponse test step dynamically. After firing the groovy script is there any option that we need to enable to show all the fields. Thanks in advance.