Skip to main content
L3gitUI · API · MOBILE TEST AUTOMATION
[ PRODUCT ][ PRICING ][ DOCS ][ VERIFIED ][ REGULATED ][ COMPARE ][ ACCOUNT ] Start Free Trial

Home › How-to guides › How to run Selenium tests in parallel on Jenkins with a Matrix pipeline — no Selenium Grid

/// CI · Jenkins

How to run Selenium tests in parallel on Jenkins with a Matrix pipeline — no Selenium Grid

Not an engineer? Read the plain-English 7-step version instead. Split a suite across several Jenkins agents and browsers. L3git writes the whole Jenkins matrix pipeline for you: shards × browsers, each cell on its own agent, running its own slice. No Grid, no hub to maintain, no cloud minutes.

About 20 minutes · step by step, no experience needed

  1. Give each agent what any Java project needs: JDK 17, Maven, and the browser(s) you want to cover (Edge, Chrome, Firefox). Label them, for example ui-test. An air-gapped agent also needs the matching WebDriver on disk — see guide 14.
  2. In L3git’s startup window open CI / Maven project. Next to Jenkins matrix set the number of shards (say 4), tick the browsers, and type the Agent label. That is the whole setup — Jenkins needs the matrix axes written literally in the file, so the tool writes them from your choices.
  3. Generate. The project’s Jenkinsfile is a declarative matrix pipeline: SHARD 1…4 × BROWSER edge/chrome = 8 cells. Commit it and create a Jenkins Pipeline from SCM job pointing at the repo.
  4. Run. Jenkins starts every cell in parallel, each on an agent with your label. Each cell asks ShardSelector which scenarios are its own and runs just those against its browser. Results from every cell land in the normal JUnit test report, and Blue Ocean shows the matrix as a grid. Need a filter? TAGS is a build parameter and combines with the shard.
How scenarios are split: by their stable @l3id tag, hashed. The same test always lands on the same shard, and adding or renaming a test never reshuffles the others — so shard results stay comparable run to run. Want perfectly even counts instead? Add --balance to the ShardSelector call. To go faster on each agent too, add -Dtest.forkCount=1C to the mvn line. Changed your mind on the fan-out? Regenerate — L3git rewrites a Jenkinsfile it generated, and never touches one you edited by hand. GitHub Actions users: the generated workflow has the same thing as a matrix — raise total.

A Grid still makes sense for one thing: many browser versions or operating systems from one job. For throughput and the browsers you actually ship on, agents you already have beat a Grid you have to run. When you do want a Grid or a cloud (BrowserStack, Sauce Labs, LambdaTest), one property in healing.properties points the same suite at it.

Done! A 40-minute suite on four agents is a 10-minute suite.

L3git UI — The browser recorder that writes your Jenkins matrix pipeline and shard selector for you — see the Selenium Grid alternative page for the why.

Start the 14-day free trial   About L3git UI

All guides: /guides · Deeper write-ups: Resources · Still stuck? Email corwinhill@l3git.com — a real person replies.