Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Validate self terminating tag

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Hi,
I am using Soatest 5.5. How do I assert a self terminating tag , these are seen when no results are returned.
See example below. I want ot verify that the tag bold and italics is present as shown here.
====================================================
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<s:Body>
<FindRelationshipTypesResponse
xmlns="http://www.blahblah.com/API/WebServer"&gt;
<FindRelationshipTypesResult
xmlns:a="http://www.blahblah.com/API/WebServer/Transport&quot;
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
<a:InformationItems/>
<a:ErrorCode>0</a:ErrorCode>
<a:ErrorParameters
i:nil="true" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/&gt;
<a:ErrorText/>
<a:RequestID>b51dc91f-256b-4a68-8960-9f109150047f</a:RequestID>
<a:ResponseTime>31</a:ResponseTime>
<a:RelationshipTypes/>
</FindRelationshipTypesResult>
</FindRelationshipTypesResponse>
</s:Body>
</s:Envelope
Tagged:

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    If you simply want to make sure the element itself (<a:RelationshipTypes/>) is present then Occurrence Assertion is the one you'll be interested in. Chain an XML Assertor to the response of your SOAP Client, and add an Occurrence Assertion (under Structured Assertion) with the XPath to RelationshipTypes element. Specify 1 as the expected occurrence.

    Hi,
    I am using Soatest 5.5. How do I assert a self terminating tag , these are seen when no results are returned.
    See example below. I want ot verify that the tag bold and italics is present as shown here.
    ====================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <s:Envelope
    xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    <s:Body>
    <FindRelationshipTypesResponse
    xmlns="http://www.blahblah.com/API/WebServer"&gt;
    <FindRelationshipTypesResult
    xmlns:a="http://www.blahblah.com/API/WebServer/Transport&quot;
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
    <a:InformationItems/>
    <a:ErrorCode>0</a:ErrorCode>
    <a:ErrorParameters
    i:nil="true" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/&gt;
    <a:ErrorText/>
    <a:RequestID>b51dc91f-256b-4a68-8960-9f109150047f</a:RequestID>
    <a:ResponseTime>31</a:ResponseTime>
    <a:RelationshipTypes/>
    </FindRelationshipTypesResult>
    </FindRelationshipTypesResponse>
    </s:Body>
    </s:Envelope

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Thanks Truong.

    [quote name='truong' date='Aug 17 2009, 05:52 PM' post='5663']
    If you simply want to make sure the element itself (<a:RelationshipTypes/>) is present then Occurrence Assertion is the one you'll be interested in. Chain an XML Assertor to the response of your SOAP Client, and add an Occurrence Assertion (under Structured Assertion) with the XPath to RelationshipTypes element. Specify 1 as the expected occurrence.


Tagged