I want to validate the presence of a text using assertTrue(), but I am getting a StackOverflow error. I am not sure that the code I have written is correct or not. Need your suggestions.
// Checking the posted text
WebElement postedtext= driver.findElement(By.cssSelector("css123"));
assertTrue("The text is verfied",postedtext.getText().equals(enteredText));
private static void assertTrue(String string, boolean equals) {
assertTrue(string,equals);}
TestNGorJunit? Logically I don't see any issue in this code block. OP have declared and invoked the sameassertTrue(String string, boolean equals). No reason for atleastTestNGto interfere.