The Selenium RC test passes when it should fail to validate True (selenium.isTextPresent ("string"))

I have a set of Selenium tests that I created in the Selenium IDE and ported to Java. In several tests, I use the Java equivalent of the command verifyTextPresentto validate some text on the page ( verifyTrue(selenium.isTextPresent())).

I found a spelling error in the text on the page when starting the test from the IDE, but the error was not detected when testing through Selenium RC / TestNG. Here is an example of the code I have and the text causing the problem (spelling error in bold):

Text

Please correct the errors below.

You need to add a smaller restriction.

IDE:

verifyTextPresent | Please correct the errors indicated below.
verifyTextPresent | You need to add at least one restriction.

Java:

verifyTrue(selenium.isTextPresent("Please correct the errors indicated below."));
verifyTrue(selenium.isTextPresent("You need to add at least one restriction."));

, Selenium RC ? - ?

+3
2

, , , verifyTrue(). , , , . , , .

checkForVerificationErrors(), , - . , , ( - ).

Selenium Google . .

+5

... assertTrue() verifyTrue(). , .

+3

Source: https://habr.com/ru/post/1783522/


All Articles