HAR Converter

Upload a HAR file to convert it to a test case.

Learn how to record a browser session as HTTP Archive (HAR) and convert it to a test case.

What is HAR?

A HAR file is a JSON-formatted file, which contains the logging of a browser interaction with a site. Most browsers will record all meta data on requests they make and also all meta data on responses they receive from the server. This includes URLs, paths, headers, authentication etc. If you want to learn more about the format, you can check out the HAR specification at:

A HAR file basically looks like this:

{
  "log": {
    "pages": [
      {
        "startedDateTime": "1970-01-01T01:00:00+01:00",
        "id": "page_25",
        "title": "http://www.example.com",
        "pageTimings": {
          "onContentLoad": 1.00000,
          "onLoad": 1.10000
        }
      }
    ]
  },
  {...}
}

How to create a HAR file

We’re using in this example the Google Chrome Browser.

  1. Open your Google Chrome
  2. Open Chrome DevTools (Cmd + Opt + I or Ctrl + Shift + I) and select Network
  3. Activate the option “preserve log” to save all requests/responses and not to lose the requests/responses after you switch to another page
  4. Open any pages you want to be recorded, submit forms, etc.
  5. When you’re done, you can right click any record in the network inspector
  6. Choose “Copy” and choose then “Copy all as HAR”
  7. Create a new file in your favorite editor and paste the copied HAR into that file
  8. Upload this file using our HAR Converter

Converting HAR to test case

You can convert the HAR file in multiple ways: using our webapp or using the forge command-line tool.

HAR upload

You can upload and convert a HAR file containing requests using our HAR Converter.

You will get a preview of your newly generated test case and the option to save it in one of your organisations.

Notice: You should not upload recorded sessions which include sensitive data like login credentials. We will store converted test cases temporarily. You should also review your converted test case, to make sure everything is correct.

Command Line Tool

You can also use our Forge CLI to convert your HAR file into a test case. For example:

forge har your-har-file.har > your-test-case-file.js
Last modified September 23, 2024