Selenium WebDriver 4

Hover to reveal a menu

Medium70 pts~25 min
  • Actions API
  • Hover
Practice app · Board Planner

Hover menus, drag and drop, context menu, click-and-hold and keyboard shortcuts.

Test URL
/lab/selenium-hover-to-reveal-a-menu

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

Objective

Use the Actions API to hover the account menu, then pick an item from the revealed submenu.

Your task

  1. 1Move the mouse over #hover-menu with Actions (moveToElement / move_to_element / move({origin})).
  2. 2Wait for #hover-submenu to be visible and assert it.
  3. 3Move to #submenu-settings and click it.
  4. 4Assert #hover-result reads “Opened: Settings”.

Acceptance criteria

  • The menu is opened by hovering with Actions
  • #hover-result shows “Opened: Settings”
  • At least 2 assertions pass

Constraints

  • Open the menu by hovering, not by clicking #hover-menu.

Selenium WebDriver 4 · Selenium · Mouse & keyboard actions