Hypertest Docs
HyperTestKnowledge Base
  • Quick Set-up
    • Install HyperTest
    • Deploy your application
    • Mirror Traffic
      • Using Kubernetes
      • Using Amazon ECS
      • Using Docker
      • Using Nginx
      • Using Goreplay
        • ElasticBeanStalk Script for Goreplay
      • Using Apache
      • Using IIS
      • Using Istio
      • Using Kong
      • Using HAProxy
      • Others
  • HyperTest Overview
    • Introduction
    • Architecture
  • Detailed Setup Guide
    • Detailed Setup Guide
      • Installation
        • Linux VM
        • Kubernetes Cluster
          • Hardware Requirements
          • Cluster Setup
            • EKS
              • Existing Application Load Balancer
              • Calculate Setup Cost for EKS Cluster
            • GCP
            • AKS
            • Self Managed
              • Microk8s with EKS-D
          • HyperTest Installation
      • Mirror Traffic
      • Configure HyperTest
      • Automate Starting a Test
        • CI Integration
          • GitHub Checks Integration
            • Mandatory checks
          • Gitlab Integration
          • Bitbucket Integration
          • Jenkins Pipeline
            • Jenkins Plugins for PR events
  • Upgrade HyperTest
    • Upgrade HyperTest
      • Linux VM
      • Kubernetes Cluster
  • User Guides
    • Usage Guide
      • Install and Configure HyperTest
        • Install HyperTest
        • Configure Base DNS
        • Add New Service
      • Tests Runs and Analysis
        • View Test Cases
        • Start New Test Run
        • Understand Your Test Run Analysis
        • Prioritize Your Error Types
        • Track Bugs
        • Ignore Errors/Desired Changes
        • View/Download Report
        • View Consolidated Dashboard Reports
        • Sign-off Reports
        • Reduce Execution Time
        • Deduplication Rules
      • Troubleshooting and FAQs
    • Best Practices Guide
      • Cost Optimization
    • Dashboard Tour
      • Dashboard
      • All Sessions
      • Regression Report
      • Notifications
      • First Test Run
      • Interactions
      • Custom Analysis
      • Configuration
    • User Management
      • Create Admin User
      • Roles, Groups & Users
      • Enabling User Signup
    • Other Guides
      • Basic Nginx Auth for Linux HT
  • Middleware
  • Advanced Features
    • Import test cases from Postman
  • Change Log
  • Troubleshooting
  • FAQs
    • Setup
    • General
    • Regression Report
  • Glossary
    • Session
Powered by GitBook
On this page
  1. User Guides
  2. Usage Guide
  3. Tests Runs and Analysis

Deduplication Rules

You can choose which request parameters to exclude or include while deduplication is done

PreviousReduce Execution TimeNextTroubleshooting and FAQs

Last updated 2 years ago

By creating a deduplication rule you can reduce the number of requests to run in a test by excluding a randomized or an irrelevant parameter that is a part of a large number of requests.

Let's take the example of a Session from the previous section to understand better:

No.
Path
Payload
1

GET /api/v1/products/5

Query: {

"lang": "en"

}

2

GET /api/v1/products/6

Query: {

"lang": "en"

}

3

GET /api/v1/products/5

Query: {}

4

GET /api/v1/products/8

Query: {

"lang": "fe"

}

5

GET /api/v1/products/6

Query: {

"lang": "en"

}

In this example we can see query parameter "lang" is not consistent in payloads and it's not a required parameter for the products API, it could very well be meta information that has little to no effect on the business logic of the API.

By default HyperTest will consider these parameters while deduplicating:

  • Path parameters

  • Query parameters

  • Body parameters

Let's create a rule to exclude the query parameter "lang".

To create a rule we will open the deduplication rules page under Settings and click on the Add Deduplication Rule button.

Upon opening the dialog you will see a bunch of fields, let's take them one by one and try to understand.

On the top left corner, you have the HTTP methods field, here you can specify the method type of your API for which you wish to create a rule, ANY is also an option so you can apply this rule to all the HTTP methods.

In our case, we want to create a rule for a "GET" API so we will select that.

Next, we have API Path, here we can mention an exact API path or we can pass a Regular Expression or a URL pattern.

Regular Expression needs a prefix keyword "REGEX:" After this, you write your expression and HyperTest will match request paths against that. Example:

REGEX:^\/api\/v1\/products\/(\d+)(\/|)$

URL pattern for this API would be:

/api/v1/products/:id

Let's go with the URL pattern because it's much easier to understand and it satisfies our use case, you can any one of them but using Regular Expression would be warranted for complex use cases where you would want to match requests based on a prefix or a particular keyword.

Next, we have a checkbox called "Should not deduplicate", you can select it if you don't want requests of an API to be deduplicated, In our case, we want to exclude some parameters of a request from the deduplication process so we definitely don't need this right now.

This option is very useful in a case where you want to run a login request with the same payload multiple times to successfully test your scenario, in this case, you should create a rule to not deduplicate login requests while HyperTest will be deduplicating other requests.

Let's look at the rest of the fields provided:

  • Query Exceptions: Here we provide the names of query parameters that you do not want to consider for deduplication.

  • Body Exceptions: Provide the paths of body parameters that you do not want to consider for deduplication e.g., "user.metaInfo.currLocation"

  • Headers Whitelist: By default, headers are not considered but you can provide the name of the headers that should be considered for deduplication.

  • Cookies Whitelist: By default, cookies are not considered but you can provide the name of the cookies that should be considered for deduplication.

In our case, we just want to remove the query parameter "lang" from the deduplication process for our API: GET /api/v1/products/:id

Let's finish creating this rule:

Now with this rule in place let's look at what happens to our sample Session:

Total Request count: 5

Without deduplication, all Requests are selected.

No.
Path
Payload
Included In Test
1

GET /api/v1/products/5

Query: {

"lang": "en"

}

2

GET /api/v1/products/6

Query: {

"lang": "en"

}

3

GET /api/v1/products/5

Query: {}

4

GET /api/v1/products/8

Query: {

"lang": "fe"

}

5

GET /api/v1/products/6

Query: {

"lang": "en"

}

Deduplication without rule at default level(Unique Request Params)

Request count: 4

Request with a unique path and query parameters are considered, including query param "lang".

No.
Path
Payload
Included In Test
1

GET /api/v1/products/5

Query: {

"lang": "en"

}

2

GET /api/v1/products/6

Query: {

"lang": "en"

}

3

GET /api/v1/products/5

Query: {}

4

GET /api/v1/products/8

Query: {

"lang": "fe"

}

5

GET /api/v1/products/6

Query: {

"lang": "en"

}

Request count: 3

Only Requests with unique path parameters are considered and the query parameter "lang" is ignored.

No.
Path
Payload
Included In Test
1

GET /api/v1/products/5

Before Rule:

Query: {

"lang": "en"

} After Rule: Query: {}

2

GET /api/v1/products/6

Before Rule: Query: {

"lang": "en"

} After Rule: Query: {}

3

GET /api/v1/products/5

Before Rule: Query: {} After Rule: Query: {}

4

GET /api/v1/products/8

Before Rule:

Query: {

"lang": "fe"

} After Rule: Query: {}

5

GET /api/v1/products/6

Before Rule: Query: {

"lang": "en"

} After Rule: Query: {}

For more information on URL patterns please refer to this documentation:

https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API