Then I should not see "value" in the "text" element by attr

This step asserts that an element identified by a CSS selector, ID, class, or other attribute does not contain a given text value. You supply an attribute value (such as uname, #error-box, or pwordcss) and the text that must be absent. The step waits up to 10 seconds for the element to be present in the DOM, then reads its full text content and fails if the expected text is found.

Use this form when you need to confirm that stale data, an error message, or a previously visible value has been removed from a specific element after an action. The attribute name is optional: omit it to let the selector helper infer the type, or specify it explicitly with by its "attrName" attr when the value alone is ambiguous. For asserting absence of text anywhere on the page, use the simpler I should not see step instead.

Accepted phrasings

Then I should not see "value" in the "attrValue" element by its "attrName" attr
Then I should not see "value" in the "attrValue" element by attr
Then we should not see "value" in the "attrValue" element by its "attrName" attr
Then we should not see "value" in the "attrValue" element by attr

Examples

Then I should not see "John Smith" in the "uname" element by its "id" attr
Then I should not see "1234" in the "pwordcss" element by attr
Then we should not see "Error" in the "#status-message" element by attr
Then I should not see "Pending" in the ".order-state" element by attr

In a real scenario

Scenario: Verify that a saved profile update replaces the old username in the display field
  Given I am a logged in user with the "editor" user
   When I go to "/account/profile"
    And I fill in "new-editor" for "edit-name" by attr
    And I press "Save"
    And wait
   Then I should not see "editor" in the "username-display" element by its "id" attr
    And I should see "new-editor" in the "username-display" element by its "id" attr

Related steps

Back to Assertion Steps