Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TestNG. How to skip data driven tests

 
Sergei Zhylinski
Ranch Hand
Posts: 84
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for everybody who has read the topic. I've coped with that by myself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic