Validate self terminating tag

LegacyForumLegacyForum Posts: 1,669 ✭✭
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/">;
<s:Body>
<FindRelationshipTypesResponse
xmlns="http://www.blahblah.com/API/WebServer">;
<FindRelationshipTypesResult
xmlns:a="http://www.blahblah.com/API/WebServer/Transport";
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">;
<a:InformationItems/>
<a:ErrorCode>0</a:ErrorCode>
<a:ErrorParameters
i:nil="true" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>;
<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

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    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/">;
    <s:Body>
    <FindRelationshipTypesResponse
    xmlns="http://www.blahblah.com/API/WebServer">;
    <FindRelationshipTypesResult
    xmlns:a="http://www.blahblah.com/API/WebServer/Transport";
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">;
    <a:InformationItems/>
    <a:ErrorCode>0</a:ErrorCode>
    <a:ErrorParameters
    i:nil="true" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>;
    <a:ErrorText/>
    <a:RequestID>b51dc91f-256b-4a68-8960-9f109150047f</a:RequestID>
    <a:ResponseTime>31</a:ResponseTime>
    <a:RelationshipTypes/>
    </FindRelationshipTypesResult>
    </FindRelationshipTypesResponse>
    </s:Body>
    </s:Envelope

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    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.


Sign In or Register to comment.