Shouldn't you run this test with 2 different data sets:

1. test, that exception is thrown on invisible element
2. test, that some kind of onclick handler worked if element is visible