Forum Discussion

logiclife's avatar
logiclife
Occasional Contributor
15 years ago

multiple assertions in one contains assertion

How can we do multiple assertions in one "contains assertion"

<ns1:Cde>NONE</ns1:Cde>
<ns1:Message>Success.No errors.</ns1:Message>

How do we get the above both in one contains assertion.

it looks like If I give None and other message in just one contains assertion, i get a missing token error

Anyone? Tx in advance.

3 Replies

  • RJanecek's avatar
    RJanecek
    Regular Contributor
    can you show ur code how you try to solve this problem and where exactly is the problem because I dont undertstand the question . You can create script assertion where you can get any element and with this element you can do what you want contains equals...
  • logiclife's avatar
    logiclife
    Occasional Contributor
    this is the request
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://xsd.lis_ws.xxx.com/">
    <soapenv:Header/>
    <soapenv:Body>
    <xsd:DeleteBuildingRequest>
    <xsd:UserAuthentication>
    <xsd:Username>test@test.com</xsd:Username>
    <xsd:Password>mfMp=</xsd:Password>
    </xsd:UserAuthentication>
    <xsd:BuildingDeleteInfo>
    <xsd:BuildingName>test</xsd:BuildingName>
    </xsd:BuildingDeleteInfo>
    </xsd:DeleteBuildingRequest>
    </soapenv:Body>
    </soapenv:Envelope>

    this is hte response

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns1:DeleteBuildingResponse xmlns:ns1="http://xsd.lis_ws.xxx.com/">
    <ns1:BuildingInfo>
    <ns1:BuildingName>test </ns1:BuildingName>
    </ns1:BuildingInfo>
    <ns1:ErrorCode>
    <ns1:Code>NONE</ns1:Code>
    <ns1:Message>pass. No issues.</ns1:Message>
    </ns1:ErrorCode>
    </ns1:DeleteBuildingResponse>
    </soapenv:Body>
    </soapenv:Envelope>

    how do i do do assert contains to assert for both "NONe and pass. no issues" in just one "contains assert" to check for the responses that I get , see the attachment
  • logiclife's avatar
    logiclife
    Occasional Contributor
    never mind I was able to add a separate assertions..