#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
🧾 FREE · TESTNG

TestNG XML Generator: Suites Without the Typos

Choose your classes, browsers, groups and parallel settings, and get a valid testng.xml.

  • 🌐 Cross-browser blocks
  • ⚡ Parallel settings
  • 🏷️ Groups and parameters

How to use the TestNG XML Generator

  1. 1. List the classesFully qualified test classes, one per line.
  2. 2. Set how to runOne test block, one per browser or one per class; parallel mode, threads, groups, parameters and listeners.
  3. 3. GenerateDownload testng.xml and run it from Maven or your IDE.

What the settings do

A TestNG suite contains one or more <test> blocks, each listing classes. Choosing one per browser repeats your classes in a block per browser, with a browser parameter your setup method reads through @Parameters("browser"); that's the usual way to run a suite on Chrome and Firefox. parallel="tests" runs those blocks at the same time, classes and methods go finer, and thread-count caps the threads. Groups filter methods by their @Test(groups = …) tags. Every value is escaped for XML, so characters like & and < in parameters are safe. Everything runs in your browser; nothing you enter is uploaded.

Worked example

The sample has three classes (login, enrolment and receipt tests), browsers chrome, firefox, parallel tests with 2 threads, groups smoke and regression included and flaky excluded, plus baseUrl and timeout parameters. The result has 2 <test> blocks, Chrome tests and Firefox tests, each with all 3 classes, running side by side. All six combinations of block style and parallel setting were checked as well-formed XML.

Tips

  • With parallel methods, keep each thread's WebDriver in a ThreadLocal.
  • Start with 2–4 threads; more threads than CPU cores rarely helps browser tests.
  • Point Maven Surefire at the file with <suiteXmlFiles>.

Frequently asked questions

Why the https DTD address?

Recent TestNG versions expect https://testng.org/testng-1.0.dtd and can refuse the old http address.

Can I run only smoke tests?

Yes. Put smoke in Include groups and leave the rest empty.

Is the TestNG XML generator free?

Yes. You can open the TestNG XML generator and fill in everything without signing up. When you generate the file for the first time, we ask once for your name and WhatsApp number; after that it, and every other Uncodemy tool, opens straight away.

More free tools

See all free tools