O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Creating a Test Suite through Code

In the previous chapter we covered the logging and reporting provided by TestNG and different ways to extend the feature to write custom reporter and loggers. In this chapter we will cover how to configure and run test suite through code. This feature helps in configuring and running tests at runtime.

In this chapter we'll cover the following topics:

  • How to run TestNG programmatically
  • Creating a TestNG suite and running it
  • Parameterization of tests
  • Including and excluding tests
  • Defining a dependency

Running TestNG programmatically

In the earlier chapters we used the testng XML configuration files to configure and define TestNG test suites. The problem with the use of XML is that they are static files and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required