TestComplete samples (both built-in and additional) are located in the <Users>\Public\Public Documents\TestComplete 14 Samples folder.
Some file managers display the Public Documents folder as Documents.
With TestComplete you create functional tests of SOAP web services. These tests consists of calling web service methods and checking the returned result values.
Need to test REST and SOAP web services? Looking for advanced features like data-driven testing and response validation?
Check out ReadyAPI – an all-in-one automated testing tool for REST and SOAP services. It is code-based on SoapUI – the world’s most popular API testing solution – and includes tons of pro features:
Support for all major web service technologies: REST, SOAP, Swagger, WSDL, WADL, OAuth 2.0, OpenID Connect, JSON, XML, and more,
Functional, security, and load tests,
Easy service mocking and virtualization,
Data-driven testing and parameterization,
Response validation with 25+ built-in assertions,
Download a free trial now to see how ReadyAPI works for you.
If needed, integrate ReadyAPI tests into your TestComplete projects for unified reporting.
TestComplete can test web services that match the following specifications:
For information on supporting WCF services, see WCF Services - Specifics of Testing.
For more information on specifying authentication information for service clients, see Specifying Web Service Credentials.
For information on data types that can be used in tests, see Supported Data Types.
Currently, TestComplete does not support testing of web services that use encryption.
To test web services in TestComplete, you use Web Service items that belong to the Web Services collection in your project. Each Web Service item contains the following information:
The web service’s URL and SOAP version.
The URL of the web service’s WSDL file.
Types and methods that the WSDL file defines.
|Note:||When parsing the WSDL file of the tested web service, TestComplete automatically creates an item0.wsdata file and stores it to the same folder where the appropriate Web Service item file (.tcWS) resides. The file stores the WSDL file and all the linked schemes. TestComplete uses the file for testing. If you move your test project to another computer, remember to copy this file with other project files.|
You use Web Service items to call web service methods in your tests and check the method results. You access Web Service items and call methods of appropriate web services by their names:
resultValue = WebServices.WebService1.MyMethod("Some string parameter", 123, true)
Once you get a result value, you can verify it. You can do it by using standard comparison statements (the
if statement in scripts, the If Then operation in keyword tests) or by using web service checkpoints (see below).
To change the API that TestComplete uses to call your web service methods, configure the Preferred Web Service API options. Enable the .NET WCF option to use the .NET API to call web service methods. Otherwise, use the native API.
Functional web service tests cannot be recorded. You create them manually by calling web service methods and checking their values from test scripts or keyword tests.
For detailed instructions on how to create a test, see –
SOAP web services use the XML format for transferred data.
In TestComplete, you can use XML checkpoints to verify XML documents easily. To use XML checkpoints to verify your web service responses:
Store an expected response in the Stores | XML collection.
Call the needed web service method.
Call the XML checkpoint to verify the method result against the stored data.
To perform all these steps, you can use the Checkpoint wizard. The wizard guides you through the baseline XMLCheckpoint element creation and generates the code or keyword test operations that call the needed web service method and verify the result. See About Web Service Checkpoints.
Refer to the following topics to learn more about creation of web service tests in TestComplete:
|To learn about …||See topic …|
|Viewing methods and objects that your tested web service uses||Exploring Web Service’s Methods and Objects|
|Calling web service methods that use ”out“ parameters||Calling Web Service Methods That Use Out Parameters|
|Generating script code that will create test objects and arrays that you will use as method parameters of the web service||Creating Objects and Arrays for Web Service Method Calls|
|Using web service checkpoints for verifying method result data||About Web Service Checkpoints|
|Specifying the user’s authentication information||Specifying Web Service Credentials|
|Creating custom SOAP requests||Prepare SOAP Requests in Scripts|
|Running tests||Running Tests|
|Running multiple test iterations using various test data||Data-Driven Testing|
TestComplete includes a sample project that demonstrates how to call web service methods from scripts, prepare complex parameters for the methods to be called and check the returned results by using script statements and checkpoints:
<TestComplete Samples>\Common\Web Service Testing\Functional Testing
|Note:||If you do not have the sample, download the TestComplete Samples package from the https://support.smartbear.com/downloads/testcomplete/samples/ page of our web site and run it.|
These projects work with a sample web service that resides on our web site:
Testing Web Services
WCF Services - Specifics of Testing
Calling Web Service Methods That Use Out Parameters
Creating Objects and Arrays for Web Service Method Calls
Prepare SOAP Requests in Scripts
About Web Service Checkpoints
Web Service Checkpoint Operation