The Simplest Way to Make Jenkins and Selenium Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use jenkins and selenium together to run browser tests on every code change. Jenkins starts the build job, and Selenium drives real browsers to check the app. This workflow catches broken pages before bad code reaches real users in production. A code push triggers the build server to pull the latest test scripts. The server then starts a test runner that opens a browser session. The browser clicks buttons, fills forms, and checks page text against expected results. When all checks pass, t

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 jenkins and selenium together to run browser tests on every code change. Jenkins starts the build job, and Selenium drives real browsers to check the app.

This workflow catches broken pages before bad code reaches real users in production. A code push triggers the build server to pull the latest test scripts. The server then starts a test runner that opens a browser session. The browser clicks buttons, fills forms, and checks page text against expected results. When all checks pass, the pipeline moves the build to the next stage.

How jenkins and selenium pass data and permissions

Data flows from the build server to the browser grid over the network. The build server holds the job schedule and pulls code from your repo. It starts a worker node that runs the test suite for that branch. That worker node sends browser commands to a remote hub or local driver.

The test script needs permissions to log in to the staging web app. Teams store test user keys in the build server secret store. The build job reads those keys at start time and passes them down. The browser driver uses those values to fill login forms on the page. After the test finishes, the browser sends pass or fail logs back home. The build server reads the exit status and marks the run green or red. It also saves screenshots and error logs so the team can fix bugs.

Common failure modes in browser test pipelines

Many teams run into trouble when they share one test account across jobs. Two jobs run at once and change the same user state in staging. The second job fails because the first job logged out or changed data. Teams also grant broad admin roles to the build worker by mistake. If a test script leaks a key, an attacker gains full staging control.

Another big issue is unlogged test runs against staging databases that hold real data. Test workers might read real emails, phone numbers, or card numbers during a run. When a test fails, the browser dumps page text into a shared build log. Now every developer with build read rights can see private user details. Network paths between the build node and browser grid often stay too open. Any host on the subnet can send commands to the open browser port.

Jenkins Pipeline Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to scope roles and network paths

You can fix these risks by scoping roles and locking down network paths. Give each build job its own test user account with basic read rights. Never share one admin login across all your parallel browser test suites. Set up your staging database so masking rewrites matched fields in results. Masking replaces emails, phone numbers, and national IDs with safe fake text.

Lock down the network path between your build workers and your browser nodes. Allow traffic to the browser grid only from known build worker network addresses. Run each browser test session inside a clean container that dies after the run. Wipe the browser cache, cookies, and local files at the end of each job. Keep your test keys out of plain text files and job console logs. Rotate the keys for your build workers and test accounts on a set schedule.

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

Should browser tests run on the main build server?

No, running browsers on the main server uses too much memory and CPU. Always run browser nodes on separate worker machines or isolated container pods.

How do we stop parallel jobs from breaking shared test data?

Assign a unique test user and isolated data set to every parallel worker. Have each job clean up its own test records before the run ends.

What is the safest way to handle test login keys?

Store test keys in a secret store and scope them to staging only. Never write keys in test code or print them in build logs.

The query runs. The emails stay hidden.