Import a Network Capture file
Relevant for: API testing
This topic describes how to create and import a Network Capture file.
Create a capture file
Use a network capture program (also known as a sniffer) to create a capture file containing a log of network activity for your application or Web service.
Note: It is strongly recommended that you capture network traffic only on your application or Web service during the network capture session to prevent the creation of invalid or unneeded activities in your test. Many network capture tools capture all network traffic on the computer where they are installed, including network traffic unrelated to your application or Web service.
Prerequisite - study the structure of your network capture file
The structure of your file depends on the type of file you import. UFT One supports .libpcap/pcap and .har network capture files.
-
For .pcap files: UFT One creates test steps based on the TCP network traffic. You can see the input and checkpoint values by viewing the TCP request and response information for a TCP stream.
Note: You must use a network capture program to view the network capture traffic for your .pcap file.
- For .har files: Using a text editor, you can view the Request and Response information in the JSON hierarchy of the file.
Note: UFT One creates a test activity based on its recognition of the TCP stream in the following ways:
-
If UFT One recognizes the TCP stream as being compatible with or matching an already existing Web Service method, UFT One creates a Web Service step.
-
If UFT One recognizes the TCP stream response as a SOAP network transaction, it creates a SOAP Request step.
-
If UFT One does not recognize the TCP stream as being similar to an existing Web Service step or a SOAP request network transaction, it creates an HTTP Request step.
Import the network capture file
-
In UFT One, with an API test open or selected, select Tools > Import Network Capture File. The Import Network Capture Dialog Box opens.
-
In the Import Network Capture Dialog Box, select the file containing your network capture data.
UFT One supports only .pcap and .har network capture files.
-
View the file details in the Info Pane of the Import Network Capture Dialog Box. If there are errors in your file, return to your network capture tool and fix the errors.
-
If you want UFT One to create checkpoints for your test steps based on the response sections of the network capture file, select the Create checkpoints from response option.
-
Click Import. If your network capture file contains many transactions, UFT One displays the progress of your import.
Note: To stop an import, click Cancel in the import progress window. All test steps created prior to your cancellation are removed from the test.
UFT One creates Web Service test steps, SOAP Request test steps, or HTTP Request test steps for each of the transactions contained in your network capture file.