I have a demo selenium cucumber project that just runs some maths expressions in google search box and validates the results.
I want the reports to show the actual value vs expected when it fails.
I'm storing the returned text as string with ..
String resultText = driver.findElement(By.cssSelector("div[class='dDoNo vrBOv vk_bk']")).getText();
and then asserting against expected which gets passed from my feature files with ...
assertTrue(resultText.equals(expectedResult));
but the reports show ...
java.lang.AssertionError: expected [true] but found [false]
I want it to display the actual expected result vs actual i.e.
java.lang.AssertionError: expected [200] but found [201]
I've also tried ...
Assert.assertEquals(expectedResult, resultText);
I'm using ... org.testng.Assert
Thanks