Weird scrolling and visibility issues with objects

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Weird scrolling and visibility issues with objects

Post by fimo420 » Thu Oct 10, 2013 7:26 am

Hi,

Ranorex is acting weird on some of our webb pages, lets see if i can explain the issue here.
Its this weird scrolling issue, if i wana click on an item or text field it will auto scroll to that object since ensure visible is true.

But this "auto scrolling" makes the page to jump up and down all the time for each object and sometimes it scrolls down to much and the object it self is not visible on the screen but ranorex think its "visible".

So i tried to make the use ensurevisible flag to false, and the jumping/scrolling has stopped.
However, then the next problem appears, if i wana click on an object that is down on the page but is not visible in the screen, it doesnt auto scroll to that object hence i get :
"Failed to move to location 'Center' within element '{ButtonTag: Edit }'.
The pointer cannot be moved to point '{X=232,Y=1214}' since it is outside of the visible desktop. "
Thats really weird, cause i've tried to do highlight of that specific object from repository and spy tool, ranorex finds it and highlights it without any issues. But when i run the test this happens :(

I'm not sure what to do here, i dont want that jumping up and down issue.
Anyone else having similiar issues or have any solution, please let me know.

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

Re: Weird scrolling and visibility issues with objects

Post by krstcs » Thu Oct 10, 2013 1:24 pm

If you are not going to use EnsureVisible then you will have to implement your own scroll mechanism.

There are several ways to do it (pseudo-code):

1. Target the /dom with a KeyShortcut({PageDn or Down}).
2. Mouse click the scroll bar or scroll button.

You can loop through these until the item's coordinates are within the visible page's coordinates.

You can also implement the scroll up in the same way, and in the same method if needed. Just check for where the object you need is in relation to the visible window and scroll appropriately.
Shortcuts usually aren't...

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Weird scrolling and visibility issues with objects

Post by fimo420 » Thu Oct 10, 2013 1:52 pm

Thanks for the suggestion, i was afraid of it, but i guess theres no other way :(