Forum Discussion

Sheena_Gu_1's avatar
16 years ago

Data Source for response validation

Hi, I am very new to SoapUI/SoapUIPro. I have response in attributes list format, I just wonder if there is an easy to to use data source for response validation.

For example. I have following responde,Is it possible that I have a data grid or xls sheet contains expected name value pair like: (EQUIPMENTID,BVC1AAMCAA). If response has that attribute: EQUIPMENTID with value BVC1AAMCAA. it will pass the the test, otherwise fail the test?

thanks a lot
sheena


<S:Body>
<ns2:getContainedEquipmentResponse xmlns:ns2="http://asp.testTestServer.com/nbs/v1-0">
<nbsACResponse name="getContainedEquipment">
<respCode>0</respCode>
<attributeContainer>
<address>
<tid>TestDev</tid>
<category>module</category>
<type>asw200d</type>
</address>
<strAttribute>
<name>DESCRIPTION</name>
<value>6-port GbE and 1-port 10GbE uplinks.</value>
</strAttribute>
<strAttribute>
<name>APSGROUPOPERMODE</name>
<value>active</value>
</strAttribute>
<strAttribute>
<name>EQUIPMENTID</name>
<value>BVC1AAMCAA</value>
</strAttribute>
<strAttribute>
<name>MODULETYPE</name>
<value>asw200d</value>
</strAttribute>
<strAttribute>
<name>MODULEID</name>
<value>1033</value>
</strAttribute>
<strAttribute>
<name>APSSWITCHADMINMODE</name>
<value>noop</value>
</strAttribute>
<strAttribute>
<name>PROTECTIONMODE</name>
<value>active</value>
</strAttribute>

...
</attributeContainer>
</nbsACResponse>
</ns2:getContainedEquipmentResponse>
</S:Body>
</S:Envelope>

1 Reply

  • Hi,

    This can be done by adding datasource step to your testcase. Add the parameters as properties and provide the values. Now in the test request, you can simply verify it using xpath match assertion.
    Use the get data method to retrieve the expected value. It will be sumthing like {#Datasource#<property name>}

    Please let know in case of further query.

    Regards,
    -