Can I view assertions errors using exceptions?

Can I view assertions errors using exceptions?

Hello Toby,

Yes, you surely can, refer to the below Java syntax to know how to catch this error and push it to LambdaTest using Lambda Exceptions.

try {
    // some GET request
    Assert.assertEquals(ActualValue, ExpectedValue);
} catch (AssertionError e) {
    Status = "failed";
    exceptionCapture.add(e.getMessage());
    ((JavascriptExecutor) driver).executeScript("lambda-exceptions", exceptionCapture);
}