WCF Services - Specifics of Testing

Applies to TestComplete 15.47, last modified on January 20, 2023
Testing web services with TestComplete is obsolete. We recommend that you use ReadyAPI, another SmartBear's automated testing tool for SOAP and REST web services.
If needed, you can run ReadyAPI tests from TestComplete.

This topic explains how you can use TestComplete to perform functional testing of WCF services. For information on creating functional tests for other web services, see About Testing Web Services.

Overview

TestComplete allows creating functional tests for WCF (Windows Communication Foundation) services. Testing such services with TestComplete is quite similar to testing other web services. You can access WCF services and call their methods in the same manner as you call methods of other web services. Therefore, this topic describes only specifics of WCF services support in TestComplete. For more information, see the other topics of the About Testing Web Services section.

The main approach used to create functional tests for WCF services is quite similar to that used for other web services. It includes the following steps:

  1. Planning a test.

  2. Adding the Web Services project item to your TestComplete project and adding a new Web Service test item to it.

  3. Specifying the path to the WSDL file with a description of the service to be tested.

  4. Exploring the service’s methods and data types in the WebService editor.

  5. Preparing data for parameterizing methods of the service to be tested.

  6. Calling the needed methods of the tested WСF service and checking results.

For details on these steps, see Creating Web Service Tests.

Like other web services, WCF services receive data from client applications and send responses within SOAP messages. One of the main features of WCF services is the ability to use various security modes and authentication mechanisms that allow the secured SOAP message exchange between clients and WCF services.

To communicate with a WCF service, TestComplete creates a helper process, tcHostingProcess.exe, which is used as a WCF client connecting to the WCF service under test and calling the needed methods of the service.

Requirements

Testing WCF services with TestComplete requires that .NET Framework ver. 3.5 or later is installed on your computer.

Supported WCF Services

TestComplete supports testing of WCF web services that use one of the following security types:

  • Unsecured WCF services that do not use authentication at all (anonymous access).

  • Basic authentication that requires client credentials (user name and password) for authentication.

  • Windows authentication that requires the client's Windows credentials for authentication.

  • NTLM authentication that uses secured Windows credentials.

  • Certificate authentication that requires that an X.509 certificate be defined.

For a complete description of possible security configurations for WCF web services, refer to the MSDN library.

TestComplete currently does not support web services that use digest authentication, authentication with security token services and authentication with trusted subsystem services.

TestComplete provides special program objects that you can use to specify the needed authentication information (such as the user name, password, domain or certificate). To access these objects, use the Credentials property of the WebService object. For more information, see the Specifying Web Service Credentials topic.

Supported Binding Types

TestComplete allows creating tests only for those WCF web services that use one of the following binding types to communicate with client applications:

  • BasicHttpBinding - WCF services communicate with client applications via endpoints that conform to the WS-I Basic Profile 1.1 specification.
  • WSHttpBinding - WCF services communicate with client applications via endpoints that conform to WS-* specifications.
  • NetTcpBinding - WCF services communicate with client applications using the desired TCP port numbers.

Creation of functional tests for WCF services that use other binding types is not supported.

Using Web Service Checkpoints for WCF Method Calls

Like testing other web services, checking results of the called WCF service methods can be done by using Web Service checkpoints. However, there are some important specifics. Quite often SOAP messages with a service’s responses contain variable data that changes from one method call to another (for instance, the date and time of the method call, some identifiers or information on security tokens, etc.). In this case, to properly check results of the service method, Web Service checkpoints should ignore such variable data. For more information on this, see Excluding Variable Data From Verification.

See Also

About Testing Web Services
Creating Web Service Tests
Creating Web Service Checkpoints
Excluding Variable Data From Verification
About Testing Web Services

Highlight search results