File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes TestNG. How to skip data driven tests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "TestNG. How to skip data driven tests" Watch "TestNG. How to skip data driven tests" New topic
Author

TestNG. How to skip data driven tests

Sergei Zhylinski
Ranch Hand

Joined: Nov 15, 2013
Posts: 56
Hello,

The issue is how to terminate data driven tests in TestNG, i.e. tests, that use data provider (a method with @DataProvider annotation). When we have different test-methods (methods with @Test annotation) we can define an attribute "dependsOnMethods" for one of them. For instance:



In this case, when the method "checkHttpResponse" failes, method "authorize" will be skipped.

And how to achieve that when we call the same method for different data? The code below



will result in several failed tests. But I want remaining data-driven tests to be skipped when one of them failes.

Thanks in advance
Sergei Zhylinski
Ranch Hand

Joined: Nov 15, 2013
Posts: 56
Thanks for everybody who has read the topic. I've coped with that by myself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TestNG. How to skip data driven tests