Creating a Mapping File (2024)

The Mapping file is a JSON file that includes an array of entries, which includes an array of requests and responses. Each request can be mapped multiple times to a single response. The JSON should have entries like the ones found in a HAR file. The following elements are mandatory:

  • URL in the request
  • Status in the response OR RedirectUrl
  • In case of NOT mapping a GET call, specify the method type as part of the request

For the URL you can use * as wildcards, which means any request that matches the pattern will be caught and mapped to the response in the file.
The mapping file should be saved locally.

Mapping file with a JSON object in response

{ "entries": [ { "request": { "url": "*/urlRequestYouWantToMock/*?=yourQueryParam" }, "response": { "status": 200, "headers": [{ "name": "Content-Type", "value": "application/json; charset=utf-8" }], "content": { "text": "{\"mock\": \"network\"}" } } } ]}

Mapping file with a method specified (for non GET mappings)

{ "entries": [ { "request": { "method": "POST", "url": "*/urlRequestYouWantToMock/*?=yourQueryParam" }, "response": { "status": 200, "headers": [{ "name": "Content-Type", "value": "application/json; charset=utf-8" }], "content": { "text": "{\"mock\": \"network\"}" } } } ]}

Mapping file with a redirectUrl in response

{ "entries": [ { "request": { "url": "*/urlRequestYouWantToMock/*?=yourQueryParam" }, "response": { "redirectUrl" : "https://www.google.com" } } ] }

Mapping file with a text in the response

{ "entries": [ { "request": { "url": "*/urlRequestYouWantToMock/*?=yourQueryParam" }, "response": { "status" : 200, "headers": [{ "name": "Content-Type", "value": "text/html; charset=UTF-8" }], "content": { "text": "mock network" } } } ] }

Creating a mapping file that enables pass-through authentication for login

If your test includes a login process, which involves passing credentials to a server, it may not work properly when running the test on the mock network, as the login request will be timed out. To solve this issue, you should create a mapping file that includes the login request and the enabled Pass-through authentication property.

The following example enables the pass-through authentication for the login request:

{"entries": [ { "request": { "url": "https://your_app_domain/login/*" }, "response": { "passthrough":true } } ]}

Replace the URL with your login URL.

To upload your mapping file:

  1. In the Test Properties pane, click Upload Custom Mapping File.

Creating a Mapping File (1)

  1. Locate the custom Mapping file that you saved and click Open to upload it.
  2. Click Save to save the activate.

Creating a Mapping File (2)

Updated 7 months ago

Creating a Mapping File (2024)
Top Articles
Social Media in Japan: New and Thriving Digital Trends
Why is it better to flash mining OS to S... ⛑️ | minerstat help
$4,500,000 - 645 Matanzas CT, Fort Myers Beach, FL, 33931, William Raveis Real Estate, Mortgage, and Insurance
417-990-0201
Matgyn
Winston Salem Nc Craigslist
Stl Craiglist
Wfin Local News
270 West Michigan residents receive expert driver’s license restoration advice at last major Road to Restoration Clinic of the year
Texas (TX) Powerball - Winning Numbers & Results
Large storage units
Elle Daily Horoscope Virgo
Knaben Pirate Download
Vichatter Gifs
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Chicken Coop Havelock Nc
Meritas Health Patient Portal
978-0137606801
Crossword Nexus Solver
Payment and Ticket Options | Greyhound
Procore Championship 2024 - PGA TOUR Golf Leaderboard | ESPN
979-200-6466
Webcentral Cuny
Prosser Dam Fish Count
Swgoh Blind Characters
Ups Drop Off Newton Ks
Dragger Games For The Brain
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
Delectable Birthday Dyes
Jurassic World Exhibition Discount Code
Pixel Combat Unblocked
Cosas Aesthetic Para Decorar Tu Cuarto Para Imprimir
Cinema | Düsseldorfer Filmkunstkinos
Revelry Room Seattle
Armor Crushing Weapon Crossword Clue
Mp4Mania.net1
Empires And Puzzles Dark Chest
Ashoke K Maitra. Adviser to CMD's. Received Lifetime Achievement Award in HRD on LinkedIn: #hr #hrd #coaching #mentoring #career #jobs #mba #mbafreshers #sales…
Rhode Island High School Sports News & Headlines| Providence Journal
Acts 16 Nkjv
13 Fun & Best Things to Do in Hurricane, Utah
Tableaux, mobilier et objets d'art
20 Mr. Miyagi Inspirational Quotes For Wisdom
Zom 100 Mbti
Maplestar Kemono
Cara Corcione Obituary
Benjamin Franklin - Printer, Junto, Experiments on Electricity
Mejores páginas para ver deportes gratis y online - VidaBytes
Anonib New
How to Choose Where to Study Abroad
Texas Lottery Daily 4 Winning Numbers
Latest Posts
Article information

Author: Tish Haag

Last Updated:

Views: 5981

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Tish Haag

Birthday: 1999-11-18

Address: 30256 Tara Expressway, Kutchburgh, VT 92892-0078

Phone: +4215847628708

Job: Internal Consulting Engineer

Hobby: Roller skating, Roller skating, Kayaking, Flying, Graffiti, Ghost hunting, scrapbook

Introduction: My name is Tish Haag, I am a excited, delightful, curious, beautiful, agreeable, enchanting, fancy person who loves writing and wants to share my knowledge and understanding with you.