Selenium: Use of TestNG XML File

Profile picture for user arilio666

So before we move into the uses of the testng.xml file. Let us discuss what testng.xml is.

What is TestNG.xml?

  • This is a configuration file that helps in organizing your tests.
  • Multiple classes of tests, suites, and tests are handled and created by this XML file.
  • Various tests are run under this single XML file, which the testers can easily control.  It makes a tester's job easier by controlling the execution of tests by putting all the test cases together and run it under one XML file.

Use Of TestNG.xml

  1. Parallel execution and group test execution can be done with ease with this XML file.
  2. Multiple test cases from various classes can be triggered using this.
  3. Can prioritize and organize test suites and tests.
  4. Annotations are used for parameterized testing @Parameter.
  5. @DataProvider for data-driven tests etc.
  6. Can assert different scenarios that help validate expected results with the actual one.
  7. Has listeners which can log our every move while testing.
Tags