Overview

The ELEMENT_CHECK step verifies various properties of elements on the page. It supports checking text content, attributes, element states, and existence.

Parameters

targetDescription
string
required
Element selector to check
assertionType
enum
required
Type of assertion to perform:
  • ELEMENT_TEXT - Check element text content
  • ELEMENT_ATTRIBUTE - Check attribute value
  • ELEMENT_STATE - Check element state
  • EXISTS - Check element exists
expectedValue
string
Expected value for text or attribute assertions
attributeName
string
Attribute name to check (required for ELEMENT_ATTRIBUTE)
elementState
enum
State to verify (required for ELEMENT_STATE):
  • visible - Element is visible
  • enabled - Element is enabled
  • editable - Element is editable

Behavior

  1. Element Location: Finds the element using the selector
  2. Property Retrieval: Gets the requested property (text, attribute, or state)
  3. Comparison: Compares actual value with expected value
  4. Result: Passes if values match, fails with details if not

Common Use Cases

  • Verifying form validation messages
  • Checking button states (enabled/disabled)
  • Validating dynamic content updates
  • Confirming element visibility
  • Checking HTML attributes (href, src, etc.)
  • Verifying text content matches expectations

Error Handling

The step will fail if:
  • The element cannot be found
  • The actual value doesn’t match the expected value
  • The element doesn’t have the specified attribute
  • The element is not in the expected state
Detailed error messages show both expected and actual values to aid debugging.