Selenium WebDriver 4

Read an attribute value

Easy30 pts~12 min
  • Attributes
  • ARIA
Practice app · Profile Settings

A settings page for clicking, typing, reading text/attributes/CSS and element state.

Test URL
/lab/selenium-read-an-attribute-value

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Assert on attributes that are not visible text.

Your task

  1. 1Open TEST_URL.
  2. 2Assert #avatar has alt “Profile avatar” and data-role “avatar”.
  3. 3Assert #reveal-button has aria-expanded “false”, click it, then assert “true”.
  4. 4Assert #hidden-panel is now displayed.

Acceptance criteria

  • getAttribute is used
  • #hidden-panel is visible
  • At least 3 assertions pass

Selenium WebDriver 4 · Selenium · Interactions