In this section:

Introduction

The Parasoft PCAP Parser reads packet capture (PCAP) files created using the Wireshark network protocol analysis tool and uses them to create traffic files that can used in Parasoft virtual assets or test scenarios.

Prerequisites

  • Java 11 or higher
  • A PCAP library (see Troubleshooting)
  • A Wireshark PCAP file
  • Parasoft SOAtest/Virtualize 2020.1 or higher

Usage

Run the com.parasoft.soavirt.utilities.pcapparser-<VERSION>.jar to convert PCAP files into traffic files. The traffic files can then be used to generate virtual assets or test scenarios in Parasoft SOAtest, Virtualize, or Continuous Testing Platform (CTP).

The basic command for running the utility is:

java -jar com.parasoft.soavirt.utilities.pcapparser-<VERSION>.jar -pcap <inputPcapFile> -traffic <outputTrafficFileName>.txt

The following example command will create an output.txt file:

java -jar com.parasoft.soavirt.utilities.pcapparser-1.1.0.jar -pcap parabank_soap_wireshark.pcap -traffic output.txt

You can convert the file into a virtual asset or test scenario. See REST and SOA Functional Tests.

You can create a traffic file that captures variable-length or fixed-length binary data by using the following command options (note that in variable-length binary data, the length field and prefix will not be included in the resulting traffic file so that it can be easily used with the Asynchronous Socket Listener and Asynchronous Socket Transport):

OptionDescription
-fixedlength <VALUE>Determines the size of the fixed-length message.
-lengthfield <VALUE>

Determines the byte length of the length field in prefixed messages. You can specify the following values: 1, 2, 3, 4, or 8.

-includelength <TRUE|FALSE>

Determines whether the length read also includes the length field size.

Default: true.

-prefixlength <VALUE>

Determines the byte length of the prefix segment at the start of binary messages before the length field.

Default: 0

-includeprefix <TRUE|FALSE>

Determines whether the length read also includes the prefix bytes.

Default: true.

To view all available commands, run java -jar com.parasoft.soavirt.utilities.pcapparser-<VERSION>.jar.

Troubleshooting

The PCAP Parser requires a native PCAP library be installed on the system. On Linux and Mac, you will need libpcap installed. On Windows, there are two libraries available: WinPcap and Npcap. You may use either one, though be aware that there might be additional configuration necessary with Npcap. See the README file that accompanies the PCAP Parser distribution for more details.

A sample PCAP file is packaged with the PCAP Parser distribution for testing purposes.

Change Log

The following updates to this extension were made.

1.1

  • Added ability to create a traffic file that captures fixed-length binary data.

Third-party Content

This extension includes items that have been sourced from third parties as outlined below.

  • pcap4j
  • pkt
  • No labels