Then I should not see "text in the page"

This step asserts that a given string of text is not present anywhere in the <body> of the current page. Unlike the positive form, it reads the body text once and checks immediately - it does not retry or wait. Use it after a wait step or after an action that should have removed the text.

The check is a plain case-sensitive substring match against the full body text content. Both I and we are accepted as the subject. If the text is found, the step fails with a message indicating what was found and that it should not have been there. For the waiting positive counterpart, see Then I should see.

Accepted phrasings

Then I should not see "text"
Then we should not see "text"
And I should not see "text"
And we should not see "text"

Examples

Then I should not see "Access denied"
Then we should not see "Edit layout"
And I should not see "Create new account"
And I should not see "You are not authorized"

In a real scenario

Scenario: Check that create new account option does not appear for anonymous users
  Given I am an anonymous user
   When I go to "/user"
    And wait
   Then I should not see "Create new account"

Related steps

Back to Assertion Steps