Running scenarios in parallel cuts suite time but requires thread-safe design: no shared static state, a WebDriver per thread, and isolated test data. Cucumber supports parallelism via JUnit 5, TestNG, or the Maven plugins.
Parallelization runs multiple scenarios (or features) concurrently. The critical requirement is THREAD SAFETY: each thread needs its own WebDriver and context, so you use ThreadLocal<WebDriver> or per-scenario DI (which already isolates state), and you must remove static/global mutable state that would collide across threads. Configure it via JUnit 5's cucumber.execution.parallel properties, TestNG's dataProviderThreadCount (AbstractTestNGCucumberTests with @DataProvider(parallel=true)), or maven-surefire/failsafe. Test data must also be isolated (unique users/records per thread) to avoid interference. Parallelism is a common scaling and interview topic because naive suites break when parallelized.
Enabling parallel execution drops a 1-hour suite to 15 minutes on 4 threads — after refactoring a static WebDriver into a ThreadLocal and giving each thread its own test user so scenarios don't collide.
You enable parallel execution and tests start failing randomly with wrong-window/stale errors. What's the root cause and fix?