Edge issue: MoveTo not going to correct place

Bug reports.
User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Edge issue: MoveTo not going to correct place

Post by Aracknid » Fri Jul 31, 2015 2:28 pm

Hi,

[NOTE: I edited this. Please see Edit info at the end]

Using Release Windows 10 Pro and Ranorex 5.4. Scripts are coded in VS 2012 using VB.NET and Ranorex API, not the Studio.

When running my scripts, I have found that Windows 10 and/or Edge is sluggish and trying to simply "click" on web elements doesn't always work when the script initially runs. So I added some code to my framework to "moveto" the element over the time span of 1 second, so I can visually see where the mouse is going to click (so I had assumed). I've noticed that often it does not move to the correct location. It moves close to the correct location. It looks like it is offset by the amount that the Edge window is offset from the top-left corner of windows, but I cannot confirm this is exactly the case. Obviously, Edge is not maximized at this point. But oddly enough, when I do the "click" it does jump it to the right spot, and most of the time the click works.

I also have issues where "moveto" doesn't move to the correct location when Edge is maximized, and it looks like it is off by only the height. So it looks like it is moving to a location about 20 pixels (just a guess) above where it should be moving to. Again, after this move, the click jumps to the right spot and the click sometimes works.

I believe by adding the "moveto" code to my framework, I slowed down the script which gives Edge/Windows more time, and is why it mostly works. If I remove the "moveto", most clicks get missed.

[Edit] To clarify, this only seems to happen when I try to act on the first element in the DOM. So in my case, I launch Edge and get my log in screen for my AUT. I enter user name and password. When I try to click the logon button, it fails. So I added moveto, which moves to the wrong location, but then the click works. This in turn will launch another DOM which is the AUT main application. In this DOM, the first click has the same issue. IT will move to the wrong location and the click will work. Once I have done the first moveto/click, from this point on it seems to work, that is all the moveto commands seem to go to the correct place and all the clicks work. Since I'm no longer using the first DOM (log in screen), I cannot confirm that further clicks in this screen would work. Sometimes in the Main AUT, other DOMs will popup as features are triggered. I have not noticed if the first moveto/click in here also has the same issue.

Is anyone else experiencing this?

Aracknid

afleitas
Certified Professional
Certified Professional
Posts: 26
Joined: Thu May 14, 2015 3:57 pm

Re: Edge issue: MoveTo not going to correct place

Post by afleitas » Tue Aug 04, 2015 1:43 pm

Hello Aracnid,

Can you post your code sample for further investigation?
Have you tried this on Ranorex Studio?

Also, note that Edge doesn't have any plugins so without the Ranorex plugin you will still have object recognition but it will be sluggish and slow.
Normal people... believe that if it ain't broke, don't fix it. Engineers believe that if it ain't broke, it doesn't have enough features yet.
-Scott Adams :)

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Edge issue: MoveTo not going to correct place

Post by Aracknid » Tue Aug 04, 2015 2:29 pm

Thanks for the feedback.

My code is too complicated to post. Basically I have a function in which I'm finding the object, and then clicking the object. This function is called 1000's of times and it only fails the first time. In this function is where I added the moveto to work around the click not working, but the first move doesn't move to the right place. I put the delay in the moveto so I could see where it was going. It clearly goes to the wrong spot, which looks like the offset off the top left corner of the DOM from the top left corner of the screen.

So basically (simplified):

Code: Select all

obj = MyRootObj.FindSingle(PathToObj, Timeout)
obj.moveto(1000) <-- this normally is not there, I added for testing purposes
obj.click
I don't use the Studio.

Aracknid

afleitas
Certified Professional
Certified Professional
Posts: 26
Joined: Thu May 14, 2015 3:57 pm

Re: Edge issue: MoveTo not going to correct place

Post by afleitas » Wed Aug 05, 2015 8:33 pm

Hello

okay, so have you attempted to add a waitforExist before attempting the move to?

The element could not have been fully loaded on the page and your are attempting to take actions on it. Maybe a validate.exit and verify.
Normal people... believe that if it ain't broke, don't fix it. Engineers believe that if it ain't broke, it doesn't have enough features yet.
-Scott Adams :)

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Edge issue: MoveTo not going to correct place

Post by Aracknid » Wed Aug 05, 2015 8:37 pm

Like I said, my code is much more complex than the sample I posted.

I have code that checks if it exists and if is visible before it tries to click it.

Aracknid

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Edge issue: MoveTo not going to correct place

Post by Aracknid » Tue Oct 06, 2015 9:03 pm

Has anyone in support looked into this yet and have any feedback as to whether or not its an issue or perhaps they need more info or something? I'm still having this problem. Here's an image explaining what I'm talking about.
Simple picture.jpg
Simple picture.jpg (58.35 KiB) Viewed 1753 times
I'm also having another issue which is related to this problem.

As already mentioned, I found that forcing a move will correct the problem... however I have some situations where the move fails and I catch an error because Ranorex thinks the spot I want to move to is not on the visible screen area. In my specific case illustrated below, an anchor element that is on the far right of the screen. My resolution is 1152x864, and as you can see from the screenshot, the control's x value is 1111 and its width is 33 which puts it on the right side (the main Edge window is maximized). However you can see that the error that was caught has it thinking the x is 1215 for the center of the item. Trust me, it is not.
ranorex thinks control is off screen.jpg
ranorex thinks control is off screen.jpg (157.37 KiB) Viewed 1753 times
For this particular scenario I can work around it by telling my script to first click something else on the left side. But I cannot start doing this for all the scripts I have... and just for Edge.

Can you please look into this.

Thanks,

Aracknid.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Edge issue: MoveTo not going to correct place

Post by Support Team » Thu Oct 08, 2015 2:21 pm

Hello Aracknid,

Thank you for the detailed description.

We were able to reproduce the issue and are currently working on a solution.

In the meantime, please use the following workaround:
Maximize the edge browser before the click- or move-action is performed.
maximize_edge.png
maximize_edge.png (8.03 KiB) Viewed 1734 times

Code: Select all

repo.MicrosoftEdge.Self.As<Form>().Maximize();
Thank you for your understanding.

Regards,
Johannes
.
Image

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Edge issue: MoveTo not going to correct place

Post by Aracknid » Thu Oct 08, 2015 2:53 pm

Even when it is maximized, it doesn't always work, as per my example with the button on the right side. I already have similar that does maximize in the same fashion, and this was the case when the button was determined to be off the screen when it wasn't.

I'll await your fix.

Thanks,

Aracknid.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Edge issue: MoveTo not going to correct place

Post by Support Team » Thu Oct 29, 2015 2:55 pm

Hello Aracknid,

Unfortunately, the bug is caused by the browser API, which returns an incorrect window rectangle.
I'm afraid that we have to wait until Microsoft provides a fix for that issue.

We couldn't reproduce the issue when the browser was started maximized.
If you are facing the same issues with the maximized browser, it would be great if you could provide a sample website, which helps us reproducing that issue.

Thank you for your understanding.

Regards,
Johannes
.
Image