I am comparing two strings using this code:
Assert.assertTrue(driver.findElement(By.cssSelector(cssSelector)).getText().equals(text));
Both String outputs are exactly the same in the output:
Merci ! Votre commande a été envoyée.
Merci ! Votre commande a été envoyée.
Tests does run many times, and it always worked until this one situation. There are no spaces inside the strings. Special characters does not cause problems in any other cases.
Any Thoughts? Thank you!
UPDATE:
I am getting the same error when comparing these strings, maybe have something in common that breaks the test:
Merci ! Votre commande a été envoyée.
Merci ! Votre commande a été envoyée.
Référence de la commande : {0}
Référence de la commande : {0}
Contactez-moi !
Contactez-moi !
Quelle est la probabilité que vous recommandiez nous à un ami ou un collègue ?
Quelle est la probabilité que vous recommandiez nous à un ami ou un collègue ?
I noticed there is a space before symbol in each case (_! / _? / _:). This (the space before symbol) never occurs in other passing assertions. I am testing like 500 of them. May be the cause?