HAR capture utility

Important: The Java utility presented here has been developed to help manual and performance testers to install a HAR certificate on the device and capture and download the transactional network traffic, but it is not a Perfecto product. Rather, it is an example of how you can leverage underlying Perfecto functionality.

An HTTP Archive (HAR) file is a JSON-formatted archive file format for logging an application’s (either browser or a native/hybrid app) interaction with HTTP servers. The HAR file format is an evolving standard, and the information contained within it is both flexible and extensible. You can expect a HAR file to include a breakdown of timings, including:

  • How long it takes to fetch DNS information.
  • How long each object takes to be requested.
  • How long it takes to connect to the server.
  • How long it takes to transfer assets from the server to the browser of each object.

See Set up HAR files for mobile testing to install a HAR certificate and capture the network traffic via automation.

With the HAR Capture Java utility, you can work on a real device in the Perfecto UI. While manually navigating through the different screens of an application, you can use the tool to capture the transactional network traffic along with the HAR certificate installation on the device. The tool will download the HAR reports to the given location. Alternatively, you can also download the HAR reports from Perfecto reports post-execution.

Tip: Download the utility periodically because it will be updated and extended based on user feedback.

Prerequisites

Using the sample Java utility requires the following:

1 | Install and run the Java utility

The following procedure walks you through installing and running the Java utility.

To install and run the Java utility:

  1. Download the compressed utility file: https://github.com/GuruAtPerfecto/HARCaptureUtility
  2. Extract the downloaded zip file.
  3. In a command-line window, navigate to the folder that contains the extracted files.
  4. Execute the following command:

    Copy
    java -jar <<JARNAME.jar>>

    For example:

    Copy
    java -jar JavaPerfectoHARUtility.jar

    This should bring up the Java utility window.

2 | Use the Java utility to capture network traffic

You can use the Java utility to test mobile and web applications. Continue with the steps relevant to you.