How can I use assertEquals to see if the exception message is correct? The test passes but I don\'t know if it hits the correct error or not.
The test I am running.
Works perfectly for me.
try{ assertEquals("text", driver.findElement(By.cssSelector("html element")).getText()); }catch(ComparisonFailure e){ System.err.println("assertequals fail"); }
if assertEquals fails ComparisonFailure will handle it