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 3. Annotations

In the previous chapter we had learned about the TestNG XML configuration file, the different features it provides, and the different ways to create a TestNG test suite.

In this chapter we will learn about TestNG annotations and the different features supported through them. These are the base of TestNG and most of the features are supported through their use of TestNG.

In this chapter we'll cover the following topics:

  • Annotations in TestNG
  • Before and After annotations
  • Test annotation
  • Disabling a test
  • Exception test
  • Time test
  • Parameterization of test
  • Passing parameters to the test methods
  • Using DataProvider for parameterized tests

Annotations in TestNG

Annotation is a feature introduced in Java 5 and is used to add metadata (data ...

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