Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Skipping Test Cases in Test Suites.

 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,

I have run into a problem while writing JUnit test cases for an automation project i have been handed over for a few weeks. Will try to give you as much details as possible, if i miss anything let me know. Here goes:

1. The testing involves 6 test suites each test suite has around 8 test cases.
2. The test suites are executed via ant.


The Junit test cases mostly include Selenium to automate web browser validations.

The issue i am facing is:

When one of the major validations in one of the test case fails, lets say in the 4th test case, it should stop executing the remaining of the test suite and skip over to the next test suite. Is there any way of achieving this?

Thanks!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not easily. JUnit is designed to run all your tests. I think you would need to write a custom runner to do what you want.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... Seems i have some more reading to do! Thanks Jeanne.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic