Seatext library / BotRefund evidence

How to Test Your Bot Detection Effectiveness: A Practical Guide

You can test bot detection by simulating automated traffic with tools like Selenium, Puppeteer, or Playwright and checking whether your system flags those sessions. The most reliable tests use varied evasion methods—headless browsers, superhuman...

Built for advertisers who need clear, refund-ready traffic evidence.

To test your bot detection, you need to simulate automated traffic and see if your system catches it. A good test uses real attack tools like Selenium or Puppeteer, varies the evasion techniques, and checks whether your detector flags those sessions. The goal is to find blind spots before real bots exploit them.

Here's a simple way to start: create a test page, run scripted sessions against it with different bot patterns, and observe which ones are blocked or flagged. Then compare those results with sessions from real visitors. The best detectors, like BotRefund, don't rely on one signal—they cross-check browser, network, device, and behavior evidence to reach a verdict.

What a bot detection test should measure

A valid test checks three things: detection rate (how many bots you catch), false positive rate (how many real users you block), and evasion resistance (how well you handle sophisticated bots). If your test only covers simple bots, you'll be overconfident.

Detection rate is the percentage of simulated bot sessions that your detector correctly flags. For a meaningful number, you need a mix of bot types. Simple bots might use plain HTTP requests or a headless browser with no extra stealth. Advanced bots patch browser APIs, use residential proxies, and mimic human timing. If your detection rate is 100% for simple bots but 40% for stealthy ones, you know where the gaps are. To measure it, run each bot session with a unique identifier, then check your detector's logs to see which sessions were labeled as bots. A good benchmark is 95% or higher for most bot types.

False positive rate is the percentage of real user sessions your detector blocks or flags as bots. This is easier to measure than it sounds. You need a control group of real visitors, clearly labeled and tracked. For a production site, you can use a privacy-conscious tag that marks a random sample of human sessions. For a staging test, you can ask a few colleagues to browse normally while your detector logs their sessions. The goal is to keep the false positive rate below 1% for high-value pages like checkout or account creation. On a lead form, you might tolerate 2-3% if the cost of a bot lead is high. To calculate it, divide the number of human sessions that got a bot label by the total number of human sessions in your test.

Evasion resistance is the hardest metric to measure because it requires you to think like an attacker. You're not just testing whether your detector works; you're testing whether it can withstand deliberate attempts to fool it. A simple bot that uses the latest Chrome version and no stealth will probably be caught. But a sophisticated bot that disables the `navigator.webdriver` flag, injects realistic mouse movements, and sleeps for random intervals might slip through. To test evasion resistance, you need to create multiple bot versions with varying levels of stealth. For example, write one Puppeteer script that uses the default settings, another that patches common fingerprinting properties, and a third that routes through a residential proxy and adds human-like delays. If your detector catches the first two but misses the third, your evasion resistance is weak. You should also test against common evasion libraries like Puppeteer-Extra with StealthPlugin, though remember that these are not undetectable by good detectors.

Real bots mimic humans. They use residential proxies, spoofed user agents, and human-like timing. Your test must include scenarios that reflect these tactics. If you only test simple curl requests, you'll never see how well your detector handles a bot that behaves almost like a real person.

Prerequisites before you test

  • A test environment that won't affect production traffic.
  • Access to bot simulation tools like Selenium, Puppeteer, or Playwright.
  • A way to record whether each session was flagged or allowed.
  • A baseline of normal human behavior from real sessions.
  • A detection system that exposes signals or logs, like BotRefund's console debug evaluator.

If you don't have a detection system yet, you can use BotRefund's free audit to see what signals it collects. You'll also need a web server or a simple HTML page to test against. If you're testing against your own site, use a staging copy to avoid polluting production analytics.

One common mistake is to test only on localhost. Localhost has a different network fingerprint than the public internet, so your detector might behave differently. Always test from a real public IP, ideally one that isn't already known as a bot source.

Step-by-step: How to run a bot detection test

Step 1: Define your test cases

List the bot types you want to catch. Common examples: headless browsers, form spammers, click fraud bots, and scraper bots. For each, describe the expected behavior. For a headless browser, you might expect missing user gesture events or inconsistent screen metrics. For a click fraud bot, you might see rapid page transitions with no scroll. Write down what signals you think your detector will see for each bot type. This helps you interpret the results later.

Create a table with columns for bot type, tool used, stealth level, expected behavior, and the detection signal you expect. For example, a Puppeteer script with no stealth might trigger the Console Debug Evaluator because `navigator.webdriver` is true. A more advanced bot might patch that flag, so you'd need to look for other clues like superhuman input speed or missing mouse movement.

Step 2: Build your bot simulation scripts

Write scripts using Puppeteer or Selenium that load your page, fill forms, move the mouse, and interact just like a real user—but with obvious flaws. For example, complete a form in under 100 milliseconds or move the pointer in a perfectly straight line. Here's a minimal Puppeteer script for a form submission bot:

const puppeteer = require('puppeteer');
(async () => {
  const browser = await puppeteer.launch({headless: true});
  const page = await browser.newPage();
  await page.goto('https://your-staging-site.com/lead-form');
  await page.type('#name', 'John Doe');
  await page.type('#email', 'john@example.com');
  await page.type('#phone', '555-1234');
  await page.click('button[type="submit"]');
  await page.waitForNavigation();
  await browser.close();
})();

This script will be caught by almost any decent detector because it runs instantly, uses a headless browser, and has no mouse movement. To make a more evasive version, add delays and move the mouse in a curved path:

await page.mouse.move(100, 200);
await page.waitForTimeout(300);
await page.mouse.move(200, 300, {steps: 10});
await page.waitForTimeout(200);

Also, patch the `navigator.webdriver` property with a page script. This tests whether your detector relies on that single signal or cross-checks others.

For each test case, create a separate script file or parametrize the script with command-line arguments. Keep the code organized so you can repeat the tests later. Save the output of each run to a structured log, like JSON, so you can easily analyze the results.

Step 3: Run the simulations against your detection

Launch your scripts from different IPs, maybe through a proxy. Record the outcome for each test session. Use a flag or an ID to track each bot in your logs. If you're using a staging site, run the scripts during a quiet time to avoid confusing the baseline. If you're testing on production, run a small number of sessions and make sure you have a way to exclude them from your analytics.

It's critical to run each bot script multiple times—at least 10 times per variant—to get statistical confidence. The more iterations, the more accurate your detection rate measurement. For a quick first pass, 10 runs per variant is enough. To measure false positive rate, you need a separate set of human sessions. Record the time intervals between your bot runs to mimic the way real attacks might come.

Use a headless browser's built-in debugging tools to verify that your detector actually receives the signals. For example, in Chrome DevTools, you can check the console for errors or warnings. For BotRefund, the console debug evaluator shows the evidence it collected for each session. This lets you see not just whether the session was flagged, but why.

Step 4: Analyze the results

Check which bots were blocked, which were allowed, and which real users were incorrectly flagged. A bot detection that misses more than a few percent of your simulated bots needs tuning.

Calculate your detection rate for each bot variant. If one variant was caught 9 out of 10 times, that's a 90% detection rate. Compare that to the overall detection rate across all variants. If you're seeing 80% for the stealthy variant and 100% for the simple one, you have an evasion resistance problem.

Calculate your false positive rate by dividing the number of human sessions that got a bot label by the total number of human sessions. For example, if 3 out of 200 human sessions were flagged as bots, your false positive rate is 1.5%. That might be too high for a checkout page, but fine for a blog.

Look for patterns in the signals your detector reported. If the stealthy bots were caught because of the Console Debug Evaluator, that means the detector is picking up on API tampering. If they were missed, perhaps they were able to patch that signal successfully. This is where the power of a multi-signal detector like BotRefund comes in. BotRefund uses 106 independent checks (source: BotRefund console debug evaluator). It doesn't rely on a single anomaly; it cross-checks each signal against the full picture. A bot that patches one check will still fail another, and the AI model weighs the complete pattern to reach a verdict.

How to interpret the results

Look for patterns. If your detector misses headless browsers but catches form spam, that's a clue about which signals matter. If it flags real users on mobile devices, that's a false positive problem.

When you see a high detection rate but also a high false positive rate, your detector is overly sensitive. It's catching everything, but that's not useful if it blocks your real customers. You need to find a balance. A good bot detection system should have a deep hierarchy of signals: browser fingerprint, network provider, device characteristics, and behavioral patterns. For example, superhuman input speed (filling a form in under 1 millisecond) is a strong bot signal (source: BotRefund signal page). But a privacy tool that strips JavaScript could also cause unusual behavior. BotRefund handles this by treating each check as evidence, not a verdict, and using an AI model to weigh the complete pattern. That's why it reports 99% accuracy (source: BotRefund detection page).

If your detector is missing bots, review which signals it's using. Are you checking for `navigator.webdriver`? That's easy to spoof. Are you measuring mouse movement? A bot can simulate that but often with too-perfect paths. A detector that relies on a single fingerprint is easy to trick. Systems like BotRefund use 106 independent checks, so even if a bot patches one, it fails another.

Common blind spots and limitations

No test is perfect. Bots evolve quickly. A test that passes today might fail tomorrow.

  • Your test only covers the scenarios you scripted. Real bots might use novel techniques that you haven't imagined.
  • If you test on a staging site, the lack of real traffic can skew your baseline for human behavior. A staging site with a few test users won't have the same variety of devices, browsers, and network types that production does. That's okay for a first pass, but you should eventually run a limited test on production.
  • Detection systems that rely on a single fingerprint are easy to trick with spoofed data. Make sure your evaluation includes multiple independent signals.
  • Your test might generate referrals or analytics noise that confuses your data. Use separate analytics properties or filter by a test cookie.

BotRefund addresses this by treating each check as evidence, not a verdict, and using an AI model to weigh the complete pattern. It also publishes specific check names, like the Console Debug Evaluator, which is one of 106 checks (source: BotRefund). This gives you a way to understand what contributes to a bot verdict.

Staging vs. production: How to run the test

Running tests on staging is safe but not fully realistic. On staging, you control the environment, so you can isolate variables. However, the lack of organic traffic means your detector might behave differently. For example, BotRefund's model might be trained on patterns from production traffic. On a staging site, it might not have enough data to compare against. That's why you should use a hybrid approach.

Start on staging to develop your scripts and verify that everything works. Use a separate staging subdomain or a local virtual machine. Run the bot simulations and confirm they appear in your logs. Then run a small set of human sessions by asking colleagues to browse the staging site normally. This gives you a baseline for false positive rate, but remember that your colleagues will behave differently from your real audience.

Next, run a limited test on production during a low-traffic time, like early Sunday morning. Use only a handful of bot sessions—maybe 20 to 50—so you don't distort your analytics. Mark these sessions with a query parameter like `?test=bot` or a cookie, so you can exclude them from reports. For human sessions, use a privacy-friendly tag on a small sample of users—perhaps 1% of all visitors. This gives you a more realistic false positive rate.

One practical tip: If you're using BotRefund, you can use the console debug evaluator to see the evidence for each session in real time. That way, you can watch a bot session and see exactly which signals triggered. This is invaluable for understanding your detector's strengths and weaknesses.

Another tip: run your test in cycles. First, run a baseline test with no stealth. Then gradually add more stealth. This shows you how much evasion resistance you have. Document each iteration so you can compare results over time.

Key facts about BotRefund's detection approach

MetricValueSource
Independent checks106BotRefund console debug evaluator
Reported accuracy99%BotRefund detection page
Ad budget stolen by botsUp to 20% of Google and Meta ad spendBotRefund homepage
Setup timeAbout one minute, no credit card requiredBotRefund homepage
Refund recoveryGoogle Ads spend dating back to 2017BotRefund homepage

These numbers come from BotRefund's own materials. Your results may vary.

Hypothetical scenario: Testing a lead generation form

Imagine you run a B2B insurance landing page. You suspect some leads are bots. You write a Playwright script that fills out the form with a fake name, a valid-looking email, and a phone number—all in 0.3 seconds. You also have a script that uses a residential proxy to hide its IP. After running 50 bot sessions and 50 real user sessions, you see that your current detection flags only 20 of the bots. The other 30 get through. That tells you your form has a gap.

You dig into the logs. The bots that got through used the residential proxy and also patched the `navigator.webdriver` flag. They also had small, random delays between keystrokes. Your detector only checked for headless browser properties and uniform IP ranges. It missed the behavioral and network signals.

Now you add BotRefund's script to the page. Its console debug evaluator detects the superhuman input speed and the lack of humanlike mouse movement, but it also checks whether those signals align with other evidence. It doesn't block just because one signal looks odd; it waits until corroboration supports the bot verdict. In your new test, the same 50 bot sessions are flagged, and you also see that the false positive rate stays under 1%.

You also notice that a few real users were flagged because they used privacy extensions. BotRefund's model saw that they had normal latency, realistic scroll patterns, and a genuine mouse path, so it did not block them. That's the difference between a rule-based system and one that weighs evidence.

Frequently asked questions

How often should I test my bot detection?

At least quarterly, or whenever you change your website structure or see a spike in suspicious traffic. Bots evolve, so a test from last year might not be relevant today.

What is the easiest way to start?

Use a free tool like BotRefund's audit to see what signals your site already leaks to bots. Then write a simple Puppeteer script and run it against your site.

Can I test without writing code?

Yes. Some services offer browser-based bot simulations. But code gives you more control over evasion techniques. If you don't code, you can use ready-made tools like Playwright's CLI to run a basic script.

How do I know if my false positive rate is acceptable?

Aim for under 1% if you have high-value pages. For lead forms, you can tolerate more false positives because the cost of a bot lead is high. For a blog with ads, a higher rate might be unacceptable if it blocks real readers.

What should I do if my test shows I'm missing bots?

Review your detection signals. Add more behavioral checks, like click patterns or session duration, and consider a service that aggregates many signals. BotRefund uses 106 checks, so a single spoofed signal won't let a bot through.

Why is a single signal not enough?

A privacy tool or a corporate network can cause a legitimate user to appear automated. If your detector blocks on that signal alone, you'll lose real users. Multi-signal systems like BotRefund cross-check each clue before making a call.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.

Learn more