I recorded an action on an element that appears when hovering, but the test fails.
Many sites have elements such as drop-down menus and buttons that appear when the user hovers the mouseover a particular element on the page.
In many cases, elements that appear and disappear in response to the user's mouseover action are newly generated when the mouseover happens or are not visible/cannot be interacted with until the mouseover is performed.
In these cases, simply recording a click step or an assertion, for example, may result in the following during test execution.
- An incorrect element responds, resulting in a [Review Needed] status.
- Errors such as "Element not found" or "Element is not interactive" occur.
You can avoid this issue by adding a "mouseover to make the target element appear" step ("hover step") before the click step or assertion step against the target element.
For more information on how to record a mouseover, please see the reference article linked below.
We will take Autify's home page (as of July 2022) as an example.
The intended behavior in the following scenario is to click the "Help Center" link. This link appears when the user hovers over "Related Documents" in the menu at the top of the screen.
(Mouseover is performed before clicking the target element.)
(The correct area was clicked.)
(Mouseover is not recorded before the "Click element" step)
(It reacted to a similar element elsewhere on the screen. As a result, the step is marked as [Review needed].)
If the above solution does not work, please get in touch via chat.