Whitelisting Test Agent

If you are having problems with tests failing it may be that you have a Firewall or Bot Manager setup to block testing from automated sources. In order to prevent your test from being blocked you can do one of the following:

User Agent Sniffing

Often services such as Cloudflare or others will block suspicious traffic to prevent overloads on servers or malicious attempts to access your site. You can setup a Firewall rule in these services to allow our servers to reach your site to prevent this from occurring.

Create a Firewall Rule

  1. Add a new Firewall rule to your service.
  2. In the request match rule, allow traffic from sources that have a user agent that has "NitecoPerfmon" in its header.

Please read the documentation of your Firewall service or contact their support to understand how to implement this within your service.

Custom HTTP Header

If your WAF (Web Application Firewall) will only accept certain headers you may run a script with your test and set the HTTP header yourself to prevent traffic from our servers being blocked.

For instance, the following script sets a header with the name "name" and the value "value," and then it navigates to the specified URL for the test:

setHeader name:value %ORIGIN%/*
navigate %URL%

Note that "name" and "value" should be swapped for the appropriate header name and value that can be configured in your WAF.

To limit the requests to which a header applies, setHeader supports a URL Pattern filter. In the example above, if the page being tested is https://example.com, then %ORIGIN%/ will be replaced withhttps://example.com/ when the script executes.

However, setHeader can also be used without a URL Pattern, but this will apply the header to all requests, which may result in some CORS requests failing.

Cookies

Due to their safety from a CORS perspective, some customers opt to use cookies as tokens for their WAF.

For instance, this script creates a cookie on the origin of the page being tested, assigning "name" as the cookie name and "value" as its value. After setting the cookie, it navigates to the designated URL for the test:

// Set a cookie on the origin of the page being tested
setCookie name:value %ORIGIN%/*

// Navigate to the configured URL for the test
navigate %URL%

In this example, replace name with the desired cookie name and the value with the appropriate cookie value. The %ORIGIN% will be replaced with the actual origin when the script runs, ensuring the cookie is set correctly for the intended page. Finally, %URL% should be replaced with the URL you want to navigate to.