The Simplest Way to Make Fastly Compute Edge and Selenium Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use Fastly Compute Edge and Selenium together to test edge routing with real browsers. Fastly runs logic near users, while Selenium drives browsers to check the live result. This workflow helps developers catch bad redirects, broken headers, and caching bugs before release. You can run browser tests right after each edge build goes out. Your team gets fast feedback on how real web pages load through the edge. How Fastly Compute Edge and Selenium share permissions and data Data flows fr

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use Fastly Compute Edge and Selenium together to test edge routing with real browsers. Fastly runs logic near users, while Selenium drives browsers to check the live result.

This workflow helps developers catch bad redirects, broken headers, and caching bugs before release. You can run browser tests right after each edge build goes out. Your team gets fast feedback on how real web pages load through the edge.

How Fastly Compute Edge and Selenium share permissions and data

Data flows from your test runner to the edge network and back again. Selenium opens a real browser and sends a web request to a Fastly domain. The edge service reads the request, runs your custom logic, and picks a backend.

Most teams protect test services at the edge so the public cannot read them. To get past these rules, Selenium attaches a test header or token to requests. The edge logic checks this key against an edge store before routing the request.

If the key matches, Fastly forwards the request to your staging backend app. The backend sends the web page back through the edge to the Selenium browser. Selenium then checks the page text, cookies, and status codes to confirm everything works.

Common failure modes and how to scope roles

Many teams make the mistake of using one shared service account for all tests. They put a static key inside the CI tool and never rotate it. If that key leaks, anyone can bypass your edge rules and hit staging apps.

Broad tokens also cause trouble when multiple teams share the same edge test service. One team can change edge state or clear caches while another team runs tests. When a test fails, unlogged requests make it very hard to find the root cause.

End-to-End Encryption + Edge Computing Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix this by giving each test run a tight, scoped role. Set up your CI runner to ask for a fresh token before each test. Store public check keys at the edge so the edge worker can check tokens fast.

Scope each token so it only works for one test path and one service. Keep your network paths tight by blocking direct public traffic to your staging backend. Set your backend to accept traffic only when it comes from trusted Fastly nodes.

Keeping browser tests fast and safe in CI

Browser tests can run slow if they wait on heavy backend systems every time. You can speed up tests by mocking slow backend answers right at the edge. The edge worker sees the test header and returns a fast, known test response.

When tests read real staging data, be careful with sensitive fields in the browser. Masking rules can rewrite emails, phone numbers, card numbers, and national IDs in results. This keeps test logs clean while Selenium checks that the page layout still works.

Always log the test run ID at the edge and in your test runner. When a browser check fails, you can match the Selenium log to the edge log. Your team will see right away if the bug is in the edge logic.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Why does Fastly block my Selenium browser tests?

Edge bot rules often flag headless browsers as bad traffic and block them. Pass a signed test token in a custom header so your edge logic allows it.

How do we test new edge logic without breaking production traffic?

Deploy your change to a separate staging service or use header routing rules. Selenium can send a specific header that triggers the new code path for tests only.

How should we store secrets needed by Selenium and the edge?

Never hardcode keys in your test code or your edge code repo. Keep secrets in your CI store and push public check keys to an edge store.

The query runs. The emails stay hidden.