testng-parallel

Configure TestNG parallel execution modes and thread-count settings.

187|20|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/TheBushidoCollective/han --skill testng-parallel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testng-parallel
Source: https://github.com/TheBushidoCollective/han/tree/main/jutsu/jutsu-testng/skills/testng-parallel
Command: npx skills add https://github.com/TheBushidoCollective/han --skill testng-parallel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configure and run TestNG tests in parallel to maximize throughput while ensuring thread safety.

Core Features & Use Cases

  • Suite-level Parallelism: Parallel tests in the same suite.
  • Class/Method Parallelism: Granular parallel execution.
  • Thread-Safety Patterns: Use thread-local storage to isolate resources.

Quick Start

Enable parallel execution in testng.xml and configure thread-count for a sample suite.

Frequently Asked Questions about testng-parallel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run TestNG tests in parallel to speed up test execution?

Enable parallel execution in testng.xml by setting the parallel attribute (suite, class, method, or instance) and configuring thread-count to control how many threads execute tests concurrently. This distributes test load across threads to maximize throughput while maintaining isolation.

What thread safety patterns should I use when running TestNG tests in parallel?

Use ThreadLocal storage to isolate resources per thread and synchronize access to shared resources. These patterns prevent data corruption and race conditions when multiple test threads access the same objects or external services simultaneously.

Can I run data providers concurrently in TestNG parallel execution?

Yes, TestNG supports data-provider concurrency alongside suite, class, and method parallelism. Configure thread-count and parallel settings in testng.xml to execute data-provider iterations concurrently while maintaining thread safety for shared resources.

How do I configure parallel execution for different test environments like multiple browsers or services?

Set parallel mode to class or method and configure thread-count to match your environment count. Use ThreadLocal storage to assign each thread its own browser instance or service connection, ensuring resource isolation across parallel test execution.

What are the parallel execution modes available in TestNG and when should I use each?

TestNG offers suite (all tests in parallel), class (tests within classes in parallel), method (individual test methods in parallel), and instance (test instances in parallel). Choose based on your test structure: method offers finest granularity, suite offers coarsest.

Do I need to modify my test code to enable parallel execution in TestNG?

Parallel execution is configured in testng.xml, not code. However, ensure your tests are thread-safe by avoiding shared mutable state and using ThreadLocal for per-thread resources. Existing thread-safe tests typically require no code changes.