Overview
Catchpoint's Request Override feature lets you run “what if” scenarios without having to deploy a new version of your website or applications. You can use this in such cases as testing a new CDN, new Ad tag, etc.
The following options are available in Request Override:
- Request Override: rewrites the request URL.
- Request Block: prevents the request from being made.
- Request Delay: increases the wait time of a request by a specified number of milliseconds - Note: Request delay is not supported for Chrome. See workaround: Delaying Requests in Chrome Transaction tests
- DNS Override: specifies the IP address or hostname to use for DNS resolution of a request.
- DNS-Resolver Override: forces the agent to use a different DNS resolver.
You can enable any of these requests overrides at the Product, Folder, or Test Level. It applies to Web and Transaction tests, for Object, Emulated, and Chrome monitors. Some limitations apply to the Chrome browser test, please see the following article for more details. https://docs.catchpoint.com/docs/certain-headers-cant-be-overridden-on-chrome-browser
Procedure
-
Select Override in the Requests section to turn off inheritance of those settings (Folder and Test properties only).

-
Click on Add HTTP Request Headers

-
Select whether the rule applies to the Test URL or Child Host (a host referenced within the page).

-
If you select Child Host you can specify the exact host to match, or use regular expression to match multiple hosts.
- To match requests for the host "ad.doubleclick.net" you would input "ad.doubleclick.net"
- To match a specific request, input the whole request as in this example
"http://www.google-analytics.com/__utm.gif" -->"www\.googleanalytics\.com/__utm\.gif"
-
In the Field option list, select (Request Override). You can override many HTTP headers but we are focusing only on Request Hosts capabilities here.

-
Input the value of the replacement:

Note: The "Apply To" field accepts regex, therefore we highly recommend that you escape special characters like ".", "*", "\", etc. The value field should not be escaped - as the agent applies this string exactly as specified.
Please do not use the expression "*" standalone in the "Apply To" field, instead if you want to match all the characters please use the ".*" expression.
Host Override:
In case you want to override the host/domain of certain child requests you can use the macros given below to implement this,
- Example (using URL
http://www.catchpoint.com:8080/main.aspx?key=value):${hostrequestauthority} – www.catchpoint.com:8080
- Example (using URL
http://www.catchpoint.com:8080/main.aspx?key=value):${hostrequestpath} – main.aspx
In this example, all the requests from the host https://www.gstatic.com/ are overridden by https://www.example.com using appropriate macro.

| Macro | Description |
|---|---|
| ${hostrequestauthority} | Obtains the given request URL’s authority (which is the host or IP plus port number, if the port is non-standard). |
| ${hostrequesthost} | Obtains the given request URL’s host. |
| ${hostrequestpath} | Obtains the given request URL’s path. |
| ${hostrequestpathandquery} | Obtains the given request URL’s path and query string. |
| ${hostrequestquery} | Obtains the given request URL’s query string. |
| ${hostrequesturl} | Obtains the given request full URL. |
| ${sequentiallist} | Returns the contained parameter values sequentially during the running of a test, and rotates to the beginning when the end is reached. |
Override using setHeader:
The Request Override feature can also be used in selenium scripts. You can specify it on a per-step basis.
The format is:
setHeader("request-override:Request_to_Match" , "New_String_to_Use)
Example:
open(www.example.com)
setHeader("request-override: www.example.com" , "cdn.example.com")