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 5. Dependencies

In the previous chapter we learned about grouping of tests which allows users to group the tests into specific named groups. In this chapter we will learn about the dependency feature in TestNG. Dependency allows users of TestNG to specify a dependency method or a dependency group for a test method.

In this chapter we'll cover the following topics:

  • Dependency test
  • Writing a multiple dependency test
  • Dependency on group
  • Using regular expressions
  • Defining dependency through XML

Dependency test

As said earlier dependency is a feature in TestNG that allows a test method to depend on a single or a group of test methods. This will help in executing a set of tests to be executed before a test method. Method dependency only works if the ...

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