Overview
There is a third party service(https://app.requestly.io/) that can be used to delay requests in Chrome. You can use this method to simulate issues which cause slow loading of resources to see how it affects overall page performance.
Note: This service adds an external dependency to the test, so it is not recommended to use this method for critical tests that measure availability.
Implementation
To delay a request with Chrome, follow the example below in a Transaction (Chrome) test.
Syntax
open("url")
setHeader(request-override:childrequest.com/image.png$,
https://app.requestly.io/delay/1000/childrequest.com/image.png?1)
The open() command is used to open the specified URL.
For the setHeader() command, the first parameter needs to end with the regex $ which establishes the end of the line. The second parameter should have an arbitrary querystring ?1 added to the URL so that it does not get overridden by the request-override header. Not having these characters would cause the request to override back to requestly.io again, causing an endless loop.
Example
open(www.foo.com) setHeader(request-override:foo.com/hey.png$, https://app.requestly.io/delay/1000/foo.com/hey.png?1)
In this example, the script is opening a URL(www.foo.com), and then overriding a child request image(foo.com/hey.png). By overriding the image, it redirects the request to requestly.io and adds a 1000ms delay. The delay time value (1000) can also be increased or decreased as needed.