Creating a project
Before you begin
- You must have closed HCL Quality Server sessions that are running if any.
- If HCL OneTest API is running and you have just completed the tasks in Creating and running a test, you probably have that project open. To create and run a stub with a WSDL file, you must create a new project. Therefore, you must close the existing project by clicking . This action closes the project and restarts HCL OneTest API.
About this task
After you restart HCL OneTest API, you must create a new project, provide a name for your project and save it on your local drive. The following instructions are applicable for the Windows OS.
Procedure
Results
What to do next
You must start the Add Numbers server and client. See Starting Add Numbers server and client.
Starting Add Numbers server and client
Before you begin
You must have created a project as described in Creating a project. Your project must be open in HCL OneTest API.
About this task
HCL OneTest API contains some example APIs. In this example, you use AddNumbers, which has a WSDL document describing the API.
If you want to model a system that does not have a WSDL definition, you can use a Swagger file (that you completed in Creating and running a test) or you can discover and record an API (that you can complete as described in Discovering, Recording, and Intercepting an HTTP proxy).
Procedure
Results
You have successfully tested a web service hosted on your local system by using the sample WSDL.
What to do next
Importing the Add Numbers server’s WSDL file to model its API
Before you begin
You must have completed testing of the web service by using the sample WSDL file.
Procedure
Results
HCL OneTest API creates service components and operations on the canvas to represent the service described in the WSDL file. The options for creating tests and stubs from the service definition are also displayed. You have already used these options to create and run a test in Creating and running a test.
What to do next
You must create a stub from the WSDL definition. See Creating a stub from the WSDL definition of the API.
Creating a stub from the WSDL definition of the API
Before you begin
You must have completed importing the WSDL in HCL OneTest API.
Procedure
Results
You have successfully created a stub from the WSDL definition for the API.
What to do next
You must run the stub created. See Running the stub.
Running the stub
Before you begin
Procedure
Results
You have successfully run the created stub.
What to do next
You must configure the client to use the created stub. See Configuring the Add Numbers client to use the stub (virtual service).
Configuring the Add Numbers client to use the stub (virtual service)
Before you begin
You must have completed creating the stub and run it.
About this task
To support HCL OneTest API Service Virtualization, you must configure HTTP clients to use the HCL OneTest API HTTP/TCP Proxy. Details about the use of this proxy are in Discovering, Recording, and Intercepting an HTTP proxy.
You configure the Add Numbers client to use the HCL OneTest API proxy by using the standard Java proxy settings.
Procedure
Results
You have successfully configured the Add Numbers client to use the stub.
What to do next
You must call the stub. See Calling the stub.
Calling the stub
Before you begin
You must have completed configuring the Add Numbers client to use the stub.
Procedure
What to do next
- To model your system when you do not have Swagger definition or WSDL files and for more details about the HTTP/TCP Proxy, see Discovering, Recording, and Intercepting an HTTP proxy.
- For an alternative procedure for creating a stub for the Add Numbers API, click the tile labeled Create a virtualized Web Service on the HCL OneTest API Home screen. This opens an internal interactive guide that walks you through creating a stub for the Add Numbers server.
- To create additional stubs for the addition operation, perform the following steps:
- Open the Test Factory perspective in HCL OneTest API.
- In the tree on the left, right-click the addition operation and click Message Exchange Pattern of the operation that was imported from the WSDL file. . This action creates a stub for the operation and an event using
- To create stubs from data from your real systems rather than entering data manually, you can record the traffic in the system under test and create stubs from those recordings. For instructions on how to record traffic for creating stubs, see Discovering, Recording, and Intercepting an HTTP proxy. You can also use the recording in combination with a WSDL or Swagger definition to model the system under test. In other words, create the service components, transport resources, and operations by synchronizing with WSDL or Swagger and then record the traffic to create tests and stubs.