How do I handle hover over links on a web page

Best practices, code snippets for common functionality, examples, and guidelines.
kdreiling
Posts: 22
Joined: Mon Sep 24, 2012 9:45 pm
Location: Kansas City

How do I handle hover over links on a web page

Post by kdreiling » Thu Jan 28, 2021 3:20 pm

Greetings!

I'd appreciate any recommendations for the following issues that I am experiencing on a recording, as stated below:

I have a top NAV bar that displays across the top of the page snd each section has a drop down with multiple links associated. On hover over a list of available resources displays that is clickable. I recorded a set where I clicked the top nav drop down and then clicking each one of the resources, but when I run the group of recordings and get farther to the right, the hover over invades the next nav bar section and failed the mouse click. Are there other options, or should I simply reserve this for manual testing?
Attachments
NavBar1.jpg
First drop down section
NavBar1.jpg (27.01 KiB) Viewed 56 times
NavBar2.jpg
Second drop down section
NavBar2.jpg (17.06 KiB) Viewed 56 times

User avatar
Stub
Posts: 427
Joined: Fri Jul 15, 2016 1:35 pm

Re: How do I handle hover over links on a web page

Post by Stub » Fri Jan 29, 2021 11:48 am

I don't really understand your scenario, but did wonder if you can you reset your position back to a known good 'clear' state after each group? As in stop and and start again without anything interfering?

kdreiling
Posts: 22
Joined: Mon Sep 24, 2012 9:45 pm
Location: Kansas City

Re: How do I handle hover over links on a web page

Post by kdreiling » Fri Jan 29, 2021 5:25 pm

Please allow me to try and give a better explanation. So the problem is when the pointer navigates from EAP Services to Legal, it is invading the Resources hover over and ties to click on the wrong resource, which, in this case, is Legal Forms. When I recorded I intentionally moved the mouse to get the correct resource, but Ranorex doesn't use that path. The only other thing I can think of is to pull the click event into a usercode, but I'm not sure what they would buy me. Here is another screen shot that I hope add clarity.
Attachments
NavBar3.jpg
NavBar3.jpg (48.6 KiB) Viewed 44 times

User avatar
Stub
Posts: 427
Joined: Fri Jul 15, 2016 1:35 pm

Re: How do I handle hover over links on a web page

Post by Stub » Mon Feb 01, 2021 9:09 am

What happens if you reduce the mouse move time to 0? There are "Duration moveTime" parameters on the Mouse.MoveTo API, though I have never used these in our scenarios that I can recall. I wonder if there's a way of having the mouse cursor instantaneously 'jump' to a position rather than 'move' to the position, IYSWIM.