Forum Discussion

pradnya2221985's avatar
pradnya2221985
Occasional Contributor
14 years ago

soap ui pro automation using groovy

Hi ,

I am working on SOAP ui for manual testing and just now I started using SOAP UI pro for automation. one module I automated with xpath which was quite simple but other module , I am not able to automate with xpath. I am not a programmer so do not have experience on java or groovy script. Is there any other way to automate following requirement?

CI ID, Type and relation as input

and output:

ci id1 , type1, relation (e.g IS parent of)
—> ci id 2, type 2, relation
—-ci id 3, type 3 , relation

ci id 1 is parent of ci id 2 and ci id 2 is parent of ci id 3
so it’s a hierarchy .

I have to compare this with database or excel file.

2 Replies

  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    hi,
    would you post your request or response which you want to implement comparison using groovy script?
    xpath is a good approach to check your expected result, but may you need to add huge expression or need to make use of Function to replace.
    so I recommend using groovy script to check your values. if you would provide more details regarding your question
  • pradnya2221985's avatar
    pradnya2221985
    Occasional Contributor
    here is the example request and response.My project is asset management. whatever assets such as operating system, distributes server present in organisation are included in this. Our task is to find the relation between these. All these configuration items are related to each other by relationship IS child of and is parent of. Our task is to find out if one of the CI type is down then which other ci types are affected.

    Now here is the tricky part. for below DS with id '1' and relation is child of , there are 3 ci types related to this id which we get in response. now for id '1' the count in response is '3' but for other id's it may vary . it may be 4,5,6 whatever.

    so in this case we have to pass different id's , relationship, ci types in request which I wanted to parametrized. and response we get dynamic depending on input so we can not use normal datasource as excel sheet will be quite long then.

    so for output we have to use actual database. and then I have to verify response for each id, relationship and related ci type to the actual database contents.


    Request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cms="http://schemaname.net/cmsws/">
    <soapenv:Header/>
    <soapenv:Body>
    <cms:RelatedConfigurationItemCriteria>
    <ConfigurationItemId>1</ConfigurationItemId>
    <configurationItemType>Distributed server</configurationItemType>
    <relationship>is child of</relationship>
    <FilterList>
    </FilterList>
    </cms:RelatedConfigurationItemCriteria>

    </soapenv:Body>
    </soapenv:Envelope>


    Response:



    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <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>
    </ns2:RelatedConfigurationItemList>
    </soap:Body>
    </soap:Envelope>