SUBSCRIBE HERE TO GET POST UPDATES VIA EMAIL :

Delivered by FeedBurner

"assertTextPresent" and "assertTextNotPresent" command in selenium IDE

"assertTextPresent" command

"assertTextPresent" command is useful for verifying and asserting selenium if given text is not present on page. It will return false as error if specified text is not present on page and will stop execution.

New Test
Command Target Value
open https://www.google.co.in/
assertTextPresent Maps
verifyTextPresent Maps

In above example, selenium IDE software testing tool will stop execution if text "Maps" not present on page.

VIEW WEBDRIVER EXAMPLES FOR ALL ASSERTION

"assertTextNotPresent" command

"assertTextNotPresent" is assertion for if specified text present on software web page. You can use this command when
you want to stop execution of selenium IDE software testing tool when some text appears on software web page.


New Test
Command Target Value
open https://www.google.co.in/
assertTextPresent Maps
assertTextNotPresent Maps
verifyTextPresent Maps

In this example, "assertTextNotPresent" will stop execution if text "Maps" present on software web page.

2 comments:

  1. assertTextNotPresent" command does not stop further execution of test case.
    Kindly explain again

    ReplyDelete
  2. I can't use verifyTextPresent command. Selenium IDE notify:
    verifyTextPresent(pattern)
    This command is deprecated. Use the verifyText command with an element locator instead.
    Pls help me!

    ReplyDelete