The real error is a NullPointerException
. I'm going to guess that somewhere in your setup (or in your test), you throw an error, and then you try to access the driver and it is null.
Either put a null check before calling driver.close()
, or make sure the driver is never null (I like the first option better).