DEV Community

Cover image for How to Test a Selenium Browser Fingerprint

How to Test a Selenium Browser Fingerprint

If you're using Selenium for web automation, web scraping, or testing, you've probably run into fingerprinting detection. Websites are getting smarter at identifying automated browsers - and blocking them.

Here's the frustrating reality: even when you use Selenium with "headless" mode or try to mask your User-Agent, modern websites can still detect you. Why? Because your browser fingerprint screams "I'm a bot."

Let me walk you through exactly how to test your Selenium browser fingerprint, what signals you're leaking, and how to fix them.

What is a Browser Fingerprint, Anyway?

A browser fingerprint is a collection of attributes that uniquely identify your browser - similar to how your actual fingerprint identifies you. Unlike cookies, you can't just delete a fingerprint. It's calculated fresh every time you visit a website.

Common fingerprinting signals include:

  • User-Agent string - Browser version and OS
  • Screen resolution - Display dimensions and color depth
  • Installed fonts - A unique list based on your system
  • Canvas fingerprint - How your GPU renders text and shapes
  • WebGL parameters - Graphics card capabilities
  • Audio context - How your audio stack processes sound
  • Timezone and language - Your locale settings
  • Browser plugins - Extensions and add-ons

When you combine these 80+ signals, you get a highly unique identifier - even without cookies. According to research by the INRIA research institute, about 90% of browsers have a unique fingerprint.

Why Selenium Browsers Stand Out

Here's the problem with vanilla Selenium: it doesn't even try to blend in. Default Selenium WebDriver configurations have several "tells" that make them easily detectable:

1. The navigator.webdriver Property

This is the most obvious signal. When you launch a browser with Selenium, it sets navigator.webdriver = true. Any website can check this property with a single line of JavaScript:

if (navigator.webdriver) {
console.log("This is an automated browser!");
}
According to fingerprinting research, over 75% of bot detection systems check this property first.

2. Missing Browser Features

Real browsers have features that Selenium browsers often lack:

  • No Permissions-Policy header in some configurations
  • Missing or incorrect chrome.loadTimes() (in older Chrome versions)
  • Unexpected navigator.plugins or navigator.languages values
  • AudioContext might return zero channels

3. Canvas and WebGL Anomalies

Automated browsers often render graphics differently. The canvas fingerprint - generated by drawing text and shapes to an HTML5 canvas - produces a hash that's inconsistent with real user devices.

Testing Your Selenium Fingerprint: Step-by-Step

Now let's get practical. Here's how to test what your Selenium browser is leaking.

Step 1: Set Up a Basic Selenium Test

First, let's create a simple Python script that launches a browser and visits a fingerprint analysis site:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

Basic Selenium setup

options = Options()

options.add_argument('--headless') # Try both headless and headed

driver = webdriver.Chrome(
service=Service(ChromeDriverManager().install()),
options=options
)

Visit a fingerprint test site

driver.get("https://amiunique.io/")

Keep the browser open for inspection

input("Press Enter to close the browser...")

driver.quit()

Step 2: Check navigator.webdriver

Run this script, open DevTools in the launched browser, and run in the console:

console.log(navigator.webdriver)
// Output: true (uh oh!)
If this returns true, you're flagged as an automated browser.

Step 3: Run a Full Fingerprint Analysis

This is where AmiUnique.io comes in handy. It's a free tool that analyzes your browser fingerprint across 80+ signals and compares you against a database of 2M+ fingerprints.

Just run the script above, and the tool will show you:

  • Your uniqueness percentile (where you fall on the bell curve)
  • Which signals make you stand out (Canvas, WebGL, fonts, etc.)
  • Whether your fingerprint has "lie detection" flags (inconsistent data)

A default Selenium browser typically scores in the 95th+ percentile for uniqueness - basically screaming "I'm automated!"

Test Your Selenium Fingerprint Now

Visit AmiUnique.io to see exactly what signals your automated browser is leaking. Free, no account required, results in seconds.

Making Your Selenium Browser More "Human"

Alright, so you've confirmed your Selenium browser has an obvious fingerprint. How do you fix it? Here are practical strategies:

1. Mask navigator.webdriver

The easiest fix is to inject JavaScript that overrides this property before the page loads:

options.add_argument("--disable-blink-features=AutomationControlled")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)

driver = webdriver.Chrome(options=options)

Execute script to override navigator property

driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
"source": """
Object.defineProperty(navigator, 'webdriver', {
get: () => undefined
})
"""
})

2. Use Undetected ChromeDriver

For serious automation, consider using undetected-chromedriver, a Python library that patches ChromeDriver to avoid detection:

import undetected_chromedriver as uc

driver = uc.Chrome()
driver.get('https://amiunique.io/')

3. Normalize Your Canvas Fingerprint

Canvas fingerprinting is harder to fix, but you can try:

  • Running in headed mode (not headless)
  • Using a VPN to match your timezone and locale
  • Injecting noise into canvas operations (advanced)
  1. Match Real Device Characteristics

Use Selenium to set realistic attributes:

Set realistic window size

driver.set_window_size(1920, 1080)

Some frameworks let you spoof properties

driver.execute_script("""
Object.defineProperty(navigator, 'plugins', {
get: () => [1, 2, 3, 4, 5]
})
Object.defineProperty(navigator, 'languages', {
get: () => ['en-US', 'en']
})
""")

Testing Your Improvements

After applying these fixes, visit AmiUnique.io again and compare your results. You should see:

  • Lower uniqueness percentile - Closer to average users
  • Fewer red flags - No automation markers
  • Consistent signals - Timezone, language, and location match
  • The goal isn't to be invisible (that's nearly impossible), but to blend in with the statistical average.

Advanced: Automated Fingerprint Testing

If you're running a large-scale scraping operation, you might want automated testing. Here's a Python script to check your fingerprint programmatically:

from selenium import webdriver
import undetected_chromedriver as uc
import time

def test_fingerprint():
driver = uc.Chrome()

try:
    driver.get("https://amiunique.io/")
    time.sleep(5)  # Wait for analysis

    # Extract your uniqueness score
    percentile = driver.find_element("css selector", ".percentile-value").text
    print(f"Your uniqueness percentile: {percentile}")

    # Check for automation flags
    webdriver_flag = driver.execute_script("return navigator.webdriver")
    print(f"navigator.webdriver: {webdriver_flag}")

finally:
    driver.quit()
Enter fullscreen mode Exit fullscreen mode

if name == "main":
test_fingerprint()

The Bottom Line

Browser fingerprinting is sophisticated, and websites are investing heavily in bot detection. Default Selenium configurations are easily identified through multiple signals - navigator.webdriver, canvas anomalies, and missing browser features.

But here's the good news: with the right tools and testing, you can significantly improve your stealth. The key is to:

  1. Test first - Use AmiUnique.io to see what you're leaking
  2. Fix the basics - Mask navigator.webdriver and normalize headers
  3. Iterate - Re-test after each change
  4. Stay updated - Detection methods evolve, so must your techniques

Understanding your browser fingerprint is the first step to better automation. Whether you're scraping for research, testing at scale, or protecting user privacy, knowledge is your best defense.

Remember: The goal isn't perfection - it's making your automation indistinguishable from legitimate traffic. Focus on blending into the statistical average rather than trying to be invisible.

Ready to Test Your Selenium Setup?

Head over to AmiUnique.io to run a comprehensive fingerprint analysis. See exactly how your Selenium browser compares to real users, and identify the signals that are giving you away.

Free • No account required • Results in seconds

Top comments (0)