Menu

1 / 2

Can AI agents find links in hover dropdown menus? 6 menu variants tested with Playwright

DEV Community: webdev·BotFumble·about 17 hours ago
#3gnItYYw
#devtowebdev#devto#dev#pricing#hover
Reading 0:00
15s threshold

An AI agent reading your page through Playwright doesn't see your nav the way your customers do. That "Product" dropdown a person opens by moving the mouse across the header? In the snapshot the model gets, the links inside it are missing until something hovers, and nothing marks "Product" as having children. It might be why a model asked to find your pricing or signup link reports that there isn't one.

Short answer: it depends on how the submenu is hidden. With display:none until :hover , playwright-cli find Pricing returned "No matches found" and get_by_role("link", name="Pricing") counted 0 until something hovered "Product". A visibility:hidden submenu was also missing from the role tree at load. With opacity:0 plus pointer-events:none , the link was in the tree but a normal click timed out.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.