Xpath is a possibility, but it gets rather complicated since it's two different possible response structures I'm checking in.
Also, I'd like to teach a solution to our testers and they are not developers and cannot be expected to fully understand xpath.
Example of a succesful response where i want to check for "Kunden eksisterer allerede":
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
<faultstring xml:lang="da-DK">Kunden eksisterer allerede</faultstring>
<detail xmlns="http://www.w3.org/2003/05/soap-envelope" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<CustomerExists xmlns="http://ementor.dk/tas/faults/customer/2008/02/22" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CorrelationId i:nil="true" xmlns="http://ementor.dk/tas/faults/core/2007/10/29"/>
<ErrorId xmlns="http://ementor.dk/tas/faults/core/2007/10/29">-1</ErrorId>
<ErrorMessage xmlns="http://ementor.dk/tas/faults/core/2007/10/29">Kunden eksisterer allerede</ErrorMessage>
</CustomerExists>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
and the alternative error response where I want to check for a certain number in the customerPrimaryNumberField:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CustomerCreateResponse xmlns="http://ementor.dk/tas/esb/customer/2007/11/06">
<CustomerCreateResult xmlns:a="http://schemas.datacontract.org/2004/07/Ementor.TAS.DataContracts.ESBCustomerServiceDataContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:customerKeyStructureField>
<a:customerPrimaryNumberField>10820873</a:customerPrimaryNumberField>
<a:customerPrimaryTypeNameField>companyname</a:customerPrimaryTypeNameField>
<a:customerSecondaryNumberField i:nil="true"/>
<a:customerSecondaryTypeNameField>none</a:customerSecondaryTypeNameField>
</a:customerKeyStructureField>
<a:lastUpdatedTimeStampField>2009-02-24T10:17:48.365</a:lastUpdatedTimeStampField>
</CustomerCreateResult>
</CustomerCreateResponse>
</s:Body>
</s:Envelope>
The problem is that both of these responses are fine, even though one of them is an error. It's simply telling me that the customer already exists which is okay for me as I need to be able to run any test multiple times, without getting "red lights"
Hmm, maybe this is really a feature request then...
I was thinking of something like two simple CONTAINS assertions, but with and OR between them.
Or expanding the CONTAINS assertion by allowing me to put several words in it with some.
or maybe makeing a new type of assertion: CONTAINS_WITH_OR that has multiple fields in the popup.