Dependency test is another feature of TestNG where group dependency can be defined using the
testng XML configuration. You can also achieve the same configuration using the API provided by TestNG. In this section we will write a sample program, which contains multiple test methods that belong to different groups. Through code we will define dependency of a group onto another group and will run the tests using this configuration.