In TestComplete, you can run functional and security API tests created with ReadyAPI or SoapUI testing tools.
This topic explains how to add an API test to your TestComplete project and run it.
Prerequisites
-
In ReadyAPI or SoapUI, create your API tests. Copy your ReadyAPI or SoapUI test project to your test computer.
-
Make sure that both the computer where you will run the tests and TestComplete meet the requirements described in the Requirements topic.
-
In the TestComplete ReadyAPI Options dialog, specify the path to the folder where ReadyAPI or SoapUI testing tools are installed.
1. Add Your API Test to a TestComplete Project
-
Open your TestComplete project or create a new one.
-
Add the ReadyAPI or SoapUI collection to the project. See Adding and Removing Project Items and Their Child Elements.
-
To run a functional API test, add a SoapUI test item to the collection.
To run a security API test, add a Secure Test item to the collection.
2. Configure the API Test
Open the added test item in the ReadyAPI Test editor and configure the item to run the needed test:
-
Specify a ReadyAPI or SoapUI project (.xml) or a composite project to run.
-
If needed, select a test suite, test case or a security test to run.
-
Specify other test parameters, if needed.
For a description of the test parameters you can configure in the editors, see ReadyAPI Test Editor.
3. Run the Test Item
To run the test from the TestComplete IDE
Open the needed tests in the ReadyAPI Test editor and click Run Test on the editor’s toolbar.
-- or --
Right-click the needed test in the Project Explorer and then click Run Test_Name.
To run the test from script
Call the ReadyAPIorSoapUICollection_Name.Test_Name.Execute
method:
JavaScript, JScript
ReadyAPI1.Test1.Execute();
Python
ReadyAPI1.Test1.Execute();
VBScript
Call ReadyAPI1.Test1.Execute
DelphiScript
ReadyAPI1.Test1.Execute;
C#Script
ReadyAPI1["Test1"]["Execute"]();
In the example, ReadyAPI1 is the name of the ReadyAPI or SoapUI collection to which the Test1 test belongs.
To run the test from a keyword test
Use the Call Object Method or Run Code Snippet operation to call the ReadyAPI.SoapUITest.Execute
method.
To run the test as the project's test item
-
Right-click your project in the Project Explorer and then click Edit | Test Items. This will open the Test Items page of the project editor.
-
Drag the needed API test to the Test Items editor.
-
Save the changes.
When you run the project, TestComplete will run the API test.
Viewing Test Results
After the test run is over, you can view the results of your API test. For information on ReadyAPI and SoapUI test results, see ReadyAPI Test Logs.
See Also
Integration With ReadyAPI and SoapUI
Execute Method
Tests and Test Items