How to use @Rule in Selenium Junit to fail a test?

As @oers says, the reason you can't find Rule is probably because your version of JUnit is too recent. Try a later version, > 4.7.

As @oers says, the reason you can't find Rule is probably because your version of JUnit is too recent. Try a later version, > 4.7. The easiest solution to your problem is just to rethrow the exception that you're catching: try { Assert. AssertEquals(ExpectedCount, ActualCount); } catch (Throwable t) { System.out.

Println ("Actual value is not equal to expected value"); throw t; } but you'll need to add throws Throwable to your test method. You have another alternative, to add a description to your assert: Assert. AssertEquals("Actual value is not equal to expected value", ExpectedCount, ActualCount).

Thanks Matthew. This works now. Cheers!

– Pritum Patel Dec 20 '11 at 20:34.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions