Search This Blog

October 30, 2014

Parasoft SOAtest: Fixed the issue of WCF: Content Type application/soap+xml; charset=utf-8 was not supported.

Today we had the new deployment to Test Environment. After the deployment, running tests via SOAtest showed the following error.

Message: Content Type application/soap+xml; charset=utf-8 was not supported by service http://xxxxxxxx.svc.  The client and service bindings may be mismatched.

Since we didn’t have any change in data contract in WCF, I needed to know what caused this issue. I tried the following ways.

Updated WSDL : the error still appeared.

Service Account: this one had the issue. After we fixed it, the error still appeared.

I  added one SOAP Client and added the URL. This time I got the different SOAP version. It just showed “Find” , not Find SOAP 1.2.  That explained why I saw the error message above.




Our Developer noticed that Bindings section was missing in web.config compared to the last build. After adding it and deploying to Test environment again, the error message above was gone.




October 22, 2014

Parasoft SOAtest: Change the default lock level to Check Out- Prevent other users from checking out and checking in

SOAtest doesn’t integrate with TFS very well and it has the merge issue. Only 1 person can check out one tst file. If 2 persons are working on the same tst file, once A checks in, B will lose his work. In this situation, when we check out the tst file,  we always select lock type- Check Out- Prevent other users from checking out and checking in.


However, the lock type of unchanged-Keep any existing lock is showing up by default. How can we change it to what we want? Here are the easy steps:  

Launch SOAtest-> Click Window->Preference->Team-Team Foundation Server->Source Control-> Choose Check Out- Prevent other users from checking out and checking in.



Next time if you would like to check out the tst file, it will show up by default .

October 16, 2014

SOAtest: Environments setting is below Test (.tst) [bad design]

In Parasoft SOAtest , if I create 1 Test (.tst) file , Environment is added below the .tst file automatically. I can switch to another environment (DEV, TEST, UAT..)  manually. What if I have 10 .tst files? It means that I have 10 environments.


If our developers change the data contracts in some WCF methods and I need to do regression tests in DEV environment first. In this situation, I need to manually change 10 times to point to DEV from TEST. After testing in DEV and we push a new build to TEST, I need to change 10 times back to TEST again.

Why not have a global environment where we can change it one time only?  I would say Environments setting below Test (.tst) is the bad design.


SOAtest, you should make your own product more user-friendly. 

October 10, 2014

Fixed the issue in SOAtest: Element could not be located or did not contain text content.

In SOAtest, I always select Value Assertion from XML Assertor to validate the data accuracy in WCF response format. Recently I have seen the following error message very often. For example,

Element "../PhoneNumberTen" could not be located or did not contain text content.

If I Click “Evaluate XPath” button, “No nodes found” message appears.



If I view the response data in the Traffic Viewer, PhoneNumberTen is blank. It means when the value is blank, SOAtest regards it as “No nodes found”.


Because the data is dynamic from SQL Server, it is possible to make the test failed due to the issue above. How do I fix this issue?

Add a new Conditional Assertion and use the following condition.

If Has Children Assertion = true

Then validate the value of PhoneNumberTen


It means when the data is blank, the validation will be ignored. 

After using this condition above, the tests pass!

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.