Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

TestNG Tutorials 8: Understanding Testng.xml : Understanding Hierarchy Of Testng.xml

Posted on 02/19/2025 By admin

Hello Folks,

In this post, we will see a very important and basic concept of TestNG : Understanding of TestNG.xml

You must aware about the hierarchy of testng.xml to implement many concept of testng. Let’s learn it:

I will generate a testng.xml for below hierarchy of project:

The generated testng.xml will be as below. I have added some extra tags for better understanding.

When we generate a testng.xml by default, it includes all methods annotated with @Test tag of a class. That is the reason you do not see  tag. I added to make you understand about hierarchy of testng.xml in above xml.

There are five levels in a testng.xml as marked in red border in above image:

  1. Method
  2. Classes
  3. Class
  4. Test
  5. Suite

You can relate all above levels with Testing Methodologies as below:

A project is divided in to different Modules. Each module is divided in to multiple Test Scenarios. Each test scenario is divided in to multiple Test Cases. Since TestNG is a testing framework, it also allows you to organize your test as you do as a manual tester. You can categorized your automation suite in same way as you do in manual testing.

  1. Method  : Test Cases
  2. Class       : Test Scenarios
  3. Classes   : Module Testing
  4. Test        : Integration Testing
  5. Suite      : System Testing

These level allows you to do extra setup for a test or module or suit. We will see more in upcoming posts, how knowledge of levels in testng.xml is going to help us.

A suite(Project) can have multiple Tests(Modules). A Test can have multiple Classes ( Please note here I am talking about tag not . You can have only single tag in a tag).

More about TestNG in upcoming posts. Stay tuned.

If you have any doubt, feel free to comment below. If you like my posts, please like, comment, share and subscribe. #ThanksForReading

#HappySelenium

Uncategorized

Post navigation

Previous Post: JSONPath Syntax
Next Post: Handling web table in selenium

Related Posts

SelectTestngXMl – Make Selenium Easy Uncategorized
TestNG Tutorials 2: Installation Of TestNG In Eclipse ==> Download And Add To Build Path Way | Make Selenium Easy Uncategorized
image – Make Selenium Easy Uncategorized
Selenium Topics – Page 37 Uncategorized
December 16, 2017 – Make Selenium Easy Uncategorized
Java Programs | Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark