Mouse Hovering in Coded Step

1 Answer 171 Views
Coded Steps
Justus
Top achievements
Rank 1
Justus asked on 27 Jul 2021, 09:28 AM

Good morning Telerik Team,

I am currently trying to hover the cursor over an element, which I already identified in a coded step.

When I try to execute the command underneath with a Rectangle Object, which i created by using getRectangle on my identified element, it says that the Objet Type is not compatible.

Manager.Desktop.Mouse.HoverOver(Rectangle)
Are there any other options to hover over an element in a coded step?

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 28 Jul 2021, 09:13 AM

Hi Justus,

I prepared a sample web test and a coded step that will hover over a HtmlAnchor element in www.google.com page. I am not sure what is your exact code doing before the HoverOver method and what is the type of "Rectangle" object in your case. This makes it hard for me to advise you and figure out what might be causing the issue. Please review the code sample below and explore the runnable test in the attachment.

            // Desktop command: HoverOver on GmailLink
            HtmlAnchor a = Find.ByExpression<HtmlAnchor>("href=~https://mail.google.com/mail/", "textcontent=Gmail",  "tagname=a");
            a.Wait.ForExists(30000);
            a.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementCenterAtWindowCenter);
            Manager.Desktop.Mouse.HoverOver(a.GetRectangle());

If you are not able to resolve the issue, please share a sample runnable test with the full code that you are using. That way I can get better understanding of the test scenario and troubleshoot it on my end.

Thank you for your cooperation in this discussion.

Regards,
Plamen Mitrev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Tags
Coded Steps
Asked by
Justus
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or