Forum Discussion

pradnya2221985's avatar
pradnya2221985
Occasional Contributor
13 years ago

Soap ui pro automation help

Hello I am doing automation for following soap request and response. I able to parametrized input using property transfer but not getting idea how to validate output response of soapui pro with database values. Can anybody please help me for this..
Its very urgent...Thanks in advance...
Request:

<ConfigurationItemId>1</ConfigurationItemId>
<configurationItemType>Distributed server</configurationItemType>
<relationship>impacts</relationship>
<FilterList>
</FilterList>
</cms:RelatedConfigurationItemCriteria>

Response:

<ns2:RelatedConfigurationItemList xmlns:ns2="http://schemaname.net/cmsws/">
<ConfigurationItem>
<name>abc</name>
<id>2</id>
<type>OPERATING SYSTEM</type>
<relationship>IS PARENT OF</relationship>
<ConfigurationItemList>
<ConfigurationItem>
<name>xyz</name>
<id>3</id>
<type>APPLICATION</type>
<relationship>IS PARENT OF</relationship>
<ConfigurationItemList/>
</ConfigurationItem>
</ConfigurationItemList>
</ConfigurationItem>
<ConfigurationItem>
<name>xxx</name>
<id>4</id>
<type>DISTRIBUTED SERVER</type>
<relationship>IS CHILD OF</relationship>
<ConfigurationItemList/>
</ConfigurationItem>
<ConfigurationItem>
<name>zzz</name>
<id>5</id>
<type>DISTRIBUTED SERVER</type>
<relationship>IS PARENT OF</relationship>
<ConfigurationItemList/>
</ConfigurationItem>

2 Replies

  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    no worries,the SoapUI is a powerful testing tool for web service, would you please clearly show your problems?
    I guess you would like to check the output with database values, right? that's not a problem, we would add XPath or XQuery assertions to check the values returned from response

    XQuery expression

    for $x in //ConfigurationItem
    return if ($x/id='2')
    then <type>OPERATING SYSTEM<type>
    else <ERROR>Error</ERROR>


    Or

    <Results>
    {
    for $x in //ConfigurationItem
    return ($x/type)
    }
    </Results>


    thanks,
    Aaron
  • pradnya2221985's avatar
    pradnya2221985
    Occasional Contributor
    Hi Aeron,

    This simple xpath and xquery I can not used because my input is parameterized and output is dynamic. meaning that on response may contains 3 records and other may contains 5 or 6...It's not fixed. For getting correct reocord in database , I have to run multiple queries in database.