Forum Discussion

OsstemImplant's avatar
OsstemImplant
Occasional Contributor
21 days ago
Solved

Hover Button...

When using the TestComplete Desktop module for record‑based automation testing, there are cases where a button is not visible and therefore cannot be clicked.

This happens when the button only appears on mouse hover.

When the mouse is manually moved to that position, the button becomes visible, but during the recorded automated test the button does not appear and the test cannot proceed.

What is the best way to hover over a button that is not visible during the test and then click it?

 

<<= Look !!!

  • Hi !

    You can use the HoverMouse action on the parent object first, then you will able to click on the button.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/onscreen/hovermouse-action-onscreen-object.html

6 Replies

  • eykxas's avatar
    eykxas
    Regular Contributor

    Hi !

    You can use the HoverMouse action on the parent object first, then you will able to click on the button.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/onscreen/hovermouse-action-onscreen-object.html

    • OsstemImplant's avatar
      OsstemImplant
      Occasional Contributor

      Thank you for your help.
      It looks a bit difficult, but I'll give it a try.

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    My first question would be, why is the button appearing on mouse hover? Is it not a bug within the application?

    • OsstemImplant's avatar
      OsstemImplant
      Occasional Contributor

      This is not a bug, it’s an intended feature.
      The X button is a delete button, so it’s hidden to prevent accidental clicks.
      It only becomes available when you hover over it.

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        Got it. Use the Object Browser to understand the behaviour of the control and see what properties are exposed. If the button object has a "hidden" property defined, then use HoverMouse method as mentioned by eykxas​. If the button object gets created on a hover mouse, then you'll need to get the parent object first, followed by the child object, which will be the button. This can be easily done with scripting, but the same can be achieved with keyword testing too.