I am wondering, by convention, when a test fails, is it appropriate to:
For instance,
fail("Accessed the element which does not exist");
or
fail("ArrayIndexOutOfBoundException was expected but something bad happened");
Which one is generally preferred/ accepted?
Given that this is testing code and shouldn't make it into the final build, I'd say the more verbose the better. As such, I'd go with the first one - it's much clearer what the root cause of the problem is, which makes it easier to correct.
I'd avoid the second one under all circumstances because it's not very helpful for a tester, and if it does somehow make it into the final build its even more cryptic than the first to an end user - it simply is no help for testers or users alike.
The one other option that I'd consider is rather than indicating that an exception occurred, instead give details of the actual exception - that's why stack traces were invented. That would convey more detail than either method listed.