Position of UI elements are incorrect when highlighted

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
drtaddei

Position of UI elements are incorrect when highlighted

Post by drtaddei » Fri Jul 18, 2014 12:26 pm

OS: Windows 8.1
Ranorex: 5.1.018625

I am finding that when using Ranorex Spy on applications it is having trouble with MenuItems, ToolBars and nested components. In the simplest cases (using windows Calculator) using the Spy it highlights locations for buttons which are not even within the bounds of the application itself. To use Calculator as an example it highlights the application window correctly and highlights menu items for View and Edit correctly but when we try and highlight "Help" it shows a location up and to the left of where help actually is. As a result in the test recordings the mouse moves to the wrong location and clicks in the wrong place.

In some cases the faulty location will also change and does not appear to be a constant offset. In other cases Spy also fails to highlight the View and Edit menu items correctly.

Am I doing something wrong? I am using a multi-monitor setup but this problem does not seem to be related.

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Position of UI elements are incorrect when highlighted

Post by Support Team » Wed Jul 23, 2014 7:25 am

Hello drtaddei,

It seems like your MSAA was not registered correctly in Windows. We faced a similar issue in the past. Please follow the steps mentioned by one of my colleagues in order to overcome the issue.

http://www.ranorex.com/forum/ranorex-ru ... tml#p23312

Regards,
Robert

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Wed Jul 23, 2014 8:38 am

Hi Robert, thank you for the reply but unfortunately I have already tried that solution but it has had no effect. Could this be a compatibility issue with Windows 8?

I have attached the snapshots of Windows Calculator. I have found that examining calculator with the 64-bit Ranorex Spy correctly highlights menu items but not their parent component. Repeating this process with the 32-bit Ranorex Spy highlights components in completely the wrong place, the highlighted area is not even within the bounds of the calculator application.

Thanks!
You do not have the required permissions to view the files attached to this post.

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Wed Jul 23, 2014 10:14 am

Further investigations this morning have revealed that this issue occurs on Windows 8 but NOT Windows 7. I was able to repeat the tests under a Windows 7 environment with no issues at all. Currently discussing the issue further with technical support.

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

Re: Position of UI elements are incorrect when highlighted

Post by krstcs » Wed Jul 23, 2014 3:58 pm

Just a thought: Have you verified that you have .NET 3.5 SDK (at a minimum) and .NET 4.0 SDK (optionally) installed in Windows 8?

Win8 comes with .NET 4.5, and Ranorex will RUN in 4.5 (due to backwards compatibility in the RUNTIME ONLY), but Ranorex needs 3.5/4.0, so you need to install the proper SDKs in order for Ranorex to truly work correctly.
Shortcuts usually aren't...

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Wed Jul 23, 2014 4:09 pm

Hi krstcs, yes I also considered that. Ranorex is using .NET version 4.0.30319.34014 on my Windows 8 and Windows 7 machine but with different results.

The thing I find troubling is actually in the RanorexSpy. Inspecting application which contain a menuStrip component. In windows 8 there appear to be two nested menuStrip components in my target application and then the menuItems but in Windows 7 there is only one menuStrip.

So in Windows 8:

App -> menuStrip1 -> menuStrip1 -> File, Edit, Help

But in Windows 7:

App -> menuStrip1 -> File, Edit, Help

Unfortunately this is not the case for the windows calculator app but it is also incorrect. Out of interest, run the calculator and RanorexSpy 32-bit and ask it to highlight the View, Edit and Help menu items. Also ask it to highlight the parent MenuBar and see what happens. Repeat this with the 64-bit RanorexSpy.

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

Re: Position of UI elements are incorrect when highlighted

Post by krstcs » Wed Jul 23, 2014 4:23 pm

I don't see any issues when looking at either Windows 8 or 8.1 Calculator's menus.


One thing I would note is that when Windows (all versions) pops up a menu, it actually creates a separate process for the menu and sub-items. This could be what is behind your issue. You need to make sure you are capturing the menu pop-ups correctly for the structure that Windows returns to Ranorex. I'm pretty sure this is a Windows "issue" and there isn't anything Ranorex can do about it. Java does the same thing with popup windows, drop-downs, menus, etc.
Shortcuts usually aren't...

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Wed Jul 23, 2014 4:35 pm

Hi krstcs, the Spy is actually failing before any pop-ups are activated. Just highlighting the menu bar shows an incorrect location. I have given the support team snapshots of the problem in both architectures in Windows 8 and Windows 7. I have not been able to re-create the problem with Java applications so I suspect there is some commonality between the calculator and my target application as far as Ranorex is concerned, we just don't know what that is yet.

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

Re: Position of UI elements are incorrect when highlighted

Post by krstcs » Wed Jul 23, 2014 5:29 pm

OK, the highlight on my MENU BAR is just a bit (maybe 3 pixels each way) off, high left.

However, the menu items are spot on, which is what you want to be manipulating anyway.
Shortcuts usually aren't...

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Thu Jul 24, 2014 7:44 am

Hi krstcs, when I use the 64-bit Spy I see the same in calculator. When I use the 32-bit spy the bounding box is not even within the application window. It is almost as if the origin of the bounding box has changed from being the top left corner to the bottom right corner. See attached screenshot.
You do not have the required permissions to view the files attached to this post.

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

Re: Position of UI elements are incorrect when highlighted

Post by krstcs » Thu Jul 24, 2014 3:24 pm

I was using the 64 bit Spy when I checked on 7, but 32 bit on 8.1 did the same (was off a bit). I just checked with 32 bit on 7 and it is dead on perfect. I don't have a 64-bit 8.1 install to check with.

Is it causing issues in your tests though?
Shortcuts usually aren't...

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Thu Jul 24, 2014 4:17 pm

Hi krstcs, yes it is causing me major issues. Our actual target application in this case (sorry I can't post screenshots or anything) has huge offsets in all the components. For some reason even using image based recording and validation the mouse keeps moving to the wrong area. It has basically rendered Ranorex useless for this particular case but as you say in Windows 7 it is dead on perfect!

Just to clarify my OS is 64-bit 8.1, I ran both the 32-bit and 64-bit Ranorex Spy to see this issue with the calculator. I am going to try another Windows 8 machine and see what happens!

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Position of UI elements are incorrect when highlighted

Post by Support Team » Mon Jul 28, 2014 3:36 pm

Hi rtaddei,

It sounds like an issue which is described in our General Troubleshooting guide.
Have you already tried to disable the "Run this program as an administrator" setting in the Compatibility settings of the Ranorex Tool EXE file as described in our General Troubleshooting section on our website (Solution reason 4).

Regards,
Bernhard

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Mon Jul 28, 2014 3:43 pm

Hi Bernhard, thank you for your reply. The suggested solution is directed at Windows 8 Apps but the applications I am testing with are not "Apps" in the Windows 8 sense. They are normal applications.

I looked at all the runtime permissions for the tools anyway and nothing is being run as administrator. (I have also tried running Ranorex and my target application as administrator but have the same results as stated above).

Thanks and keep trying!

drtaddei

Re: Position of UI elements are incorrect when highlighted

Post by drtaddei » Tue Jul 29, 2014 8:56 am

All, a further update. We have installed Ranorex on a different Windows 8 system and cannot re-create this issue. It is possible this issue is unique to my particular machine but I am at a loss as to why!

Thanks!