Selenium IDE has many commands related to text for software web application. Few of them are "assertText", "assertTextPresent", "storeText", "waitForTextPresent" etc. You can view more related commands with example at our Selenium IDE all commands collection page. "verifyTextNotPresent"
and "waitForTextNotPresent" are also used for text on page. "verifyTextNotPresent" is verification command while "waitForTextNotPresent" is waitFor command of selenium IDE. Let me describe both commands with example.
"verifyTextNotPresent" Command
"verifyTextNotPresent" is just verification command so it will not take any action but return true or false based on matching text pattern. It will be pass if targeted text is not present on page. If targeted text is present on the page then this command will be fail and return '[error] true' in log.
"waitForTextNotPresent" Command
"waitForTextNotPresent" will wait selenium IDE for text to disappear from page. Once targeted text disappeared from page, selenium IDE will execute next command.
New Test | ||
Command | Target | Value |
open | http://only-testing-blog.blogspot.com/2013/09/test.html | |
verifyTextNotPresent | Time left:* | |
waitForTextNotPresent | Time left:* | |
verifyTextNotPresent | Time left:* | |
clickAndWait | css=#submitButton |
In above example, 1st "verifyTextNotPresent" command will fail and return '[error] true' in log because initially targeted text is there on the page. Next "waitForTextNotPresent" command will wait for text to disappear from page and once targeted text "Time left:*" will disappear from page, selenium will execute next command. Now 3rd "verifyTextNotPresent" command will be pass.
No comments:
Post a Comment