You can command LoadNinja to block requests to certain resources while replaying scripts in the recorder or during load test runs. These resources may include unwanted advertisement banners, tools you use to gather visitor statistics (such as Google Analytics), and so on.
To provide a list of unwanted resources:
-
Select Add > URLs to block on the script recorder’s toolbar.
-
In the subsequent dialog, specify the URL of the resource you need to block, then click Add URL.
Note: You can use regular expressions instead of generic URLs. To learn more, see below.
-
Repeat this action to add more URLs, if needed.
To edit a URL, click .
To remove a URL from the list, click .
-
Once done, click Done.
To modify this list later, simply click # blocked URL(s) in the script recorder.
Resource syntax
LoadNinja allows to block both URLs and IP addresses:
-
Block by URL – Use this to block requests by hosts and domains.
For example:
google.com
,test.com
.You can use wildcards to block multiple URLs at once:
*example.com
blocks every host and domain on example.com, including bothexample.com
ortest.example.com
*:3000
blocks every request from any resource sent via port 3000, includingexample.com:3000
ortest.org:3000
-
Block by IP – Use this to block requests from IP addresses you know to be unwanted, like metric tools.
For example:
8.8.8.8
,12.34.56.78
.