Search This Blog

October 9, 2014

Fixed the issue: Use Has Children Assertion to validate part of a string in SOAtest

Our Developer changed the error message in the WCF response format. Due to the long Error Message, how did I validate the error message in SOAtest? The best way in my mind was to contain some keywords such as System.NullReferenceException in SOAtest. 


Long Error Message

Text: System.NullReferenceException: Object reference not set to an instance of an object.   at
.................
System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)




Could SOAtest handle “String Contain”  like C#?  After looking into this interesting issue, I set up the following variable.



I tried “Has Content Assertion”, and it didn't work. I tried “Has Children Assertion" and it worked perfectly.  I would say it is nice to validate part of a string via Has Children Assertion in SOAtest.



No comments: