Ranorex 6 is clicking on icons in the task bar

Bug reports.
Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Ranorex 6 is clicking on icons in the task bar

Post by Vaughan.Douglas » Fri May 13, 2016 3:08 pm

I've been struggling with the ensurevisible method in my particular AUT in general so I upgraded from Ranorex 5.4.5 to 5.4.6 and finally this week to 6.0.0. Unrelated to the ensurevisible issue: when ranorex 6.0.0 locates an item that exists UNDER the task bar it will perform the desired action on that location, but rather than clicking the button or whatever it click the icon in the task bar.
taskbarError.png
taskbarError.png (43.5 KiB) Viewed 1589 times
Notice in the image the target is just barely visible above the task-bar, and it clicks at center of the object. I realize I could adjust the click location, but as it happens when this is run on my virtual machine with a slightly different screen size, that target object is just enough further now that clicking at the top doesn't work either.

Now ensurevisible doesn't seem to help at all, I just happened to come across this issue when I was trying different means to make other problem object visible. This object has not cause me any trouble before upgrading to Ranorex 6.

There isn't any special code to show. This just occurs when the object happens to line up just right under the task bar.

I'm using IE version 11.0.31
Windows 7
Ranorex 6
Doug Vaughan

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3937
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex 6 is clicking on icons in the task bar

Post by odklizec » Fri May 13, 2016 3:59 pm

Hi,

Have you considered to enable the auto-hide option in the windows taskbar settings? I know, it's not a solution, rather a workaround, but it may help? ;) I agree that EnsureVisible should detect the windows taskbar and move the element in question outside its rectangle to make it 100% visible.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex 6 is clicking on icons in the task bar

Post by krstcs » Fri May 13, 2016 4:12 pm

Are you sure you application itself isn't behind the taskbar? Ensure visible may not work correctly if the application window is partially off-screen or covered up by another application. There's only so much that Ranorex can do.

Have you tried starting the application maximized? If not, please try that.
Shortcuts usually aren't...

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Ranorex 6 is clicking on icons in the task bar

Post by Vaughan.Douglas » Mon May 16, 2016 1:29 pm

krstcs wrote:Are you sure you application itself isn't behind the taskbar? Ensure visible may not work correctly if the application window is partially off-screen or covered up by another application. There's only so much that Ranorex can do.

Have you tried starting the application maximized? If not, please try that.
Yes, the browser is opened and maximized immediately. Looking closely at the initial screenshot, I am able to discern the desktop background image underneath the task bar. As I mentioned in the original post, this is not new automation. This is new behavior that I've not seen prior to release 6.0. I am open to the idea that this issue has just never manifested until now, but I find that pretty unlikely.
odklizec wrote:Hi,

Have you considered to enable the auto-hide option in the windows taskbar settings? I know, it's not a solution, rather a workaround, but it may help? ;) I agree that EnsureVisible should detect the windows taskbar and move the element in question outside its rectangle to make it 100% visible.
I've considered using auto-hide, but as soon as the mouse would go down to click the object the taskbar would return.
Doug Vaughan

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex 6 is clicking on icons in the task bar

Post by krstcs » Mon May 16, 2016 2:37 pm

Yeah, I think you're right that this is a bug, just wanted to make sure.
Shortcuts usually aren't...

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Ranorex 6 is clicking on icons in the task bar

Post by Vaughan.Douglas » Mon May 16, 2016 4:26 pm

krstcs wrote:Yeah, I think you're right that this is a bug, just wanted to make sure.
So things keep getting more interesting. Since ensurevisible wasn't working for this particular object I wrote the following method as a work around:

Code: Select all

    <Extension()>
    sub Stupid(objAdapter As Ranorex.Adapter)
        dim myXpath As Core.RxPath = objAdapter.GetPath()
       Do While Host.Local.FindSingle(myXpath).ScreenRectangle.Bottom > Host.Local.ScreenRectangle.Bottom or Host.Local.ScreenRectangle.Bottom - Host.Local.FindSingle(myXpath).ScreenRectangle.Bottom < 15
            Ranorex.Report.Warn("Stupid", "object bottom: " & Host.Local.FindSingle(myXpath).ScreenRectangle.Bottom & " Screen bottom: " & Host.Local.ScreenRectangle.Bottom)
            Ranorex.Mouse.ScrollWheel(-100)
         Loop        
    End sub
The method works and scrolls the target object up. However as soon as I use the click method Ranorex seems to scroll back to the top of the page placing my object right back below the taskbar.

This happens regardless of the state of UseEnsureVisible.

When I changed the click to performclick, nothing happened. When I inserted a focus between the custom method and the performclick, things start to function as expected.

I'm actually experiencing similar issues with select boxes where ensure visible will bring the list object into view, but when you try to click on it the screen resets and it appears as if ranorex literally misses the click.
Keep in mind this is all existing automation. Not sure what to think at this point.
Doug Vaughan

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex 6 is clicking on icons in the task bar

Post by krstcs » Mon May 16, 2016 4:54 pm

Would it be possible for you to post a Ranorex Snapshot of the page with the problematic element? If not, you can send it to [email protected] and they can help you more.
Shortcuts usually aren't...