Selenium WebDriver 4

Move to an element and click

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

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

Test URL
/lab/selenium-move-to-an-element-and-click

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

Objective

Move the pointer through the hover menu to the Profile item and click it in one Actions chain.

Your task

  1. 1Build a chain: moveToElement(#hover-menu), moveToElement(#submenu-profile), click(), perform().
  2. 2Wait for #submenu-profile to be visible between the two moves if needed.
  3. 3Assert #hover-result reads “Opened: Profile”.

Acceptance criteria

  • moveToElement is used before clicking
  • #hover-result shows “Opened: Profile”
  • At least 1 assertion passes

Selenium WebDriver 4 · Selenium · Mouse & keyboard actions