How do I prevent Ranorex from scrolling items into view or around?
I'm using EnsureVisible on an item in an iFrame that is "popped up" over the main iFrame in my web doc. I need to do this to force it to scroll the item I want to click into view in the popped up iframe, but it is also scrolling the entire page as well to move the item within the iframe to the top of my main iFrame.
The problem is that the main iFrame is made of 2 DIVs; a header div and a content Div. The header DIV overlaps the content DIV (maybe bad design or maybe on purpose... don't really know). Because the pop up iFrame is within the content Div, it gets scroll to the top of this div and it ends up covered by the header div. So when the click on the item in the popped up iframe occurs, it is actually on the header which overlaps it.
I figure maybe there is a way to use ensurevisible without scrolling the whole page?
Thoughts?
Aracknid.
Prevent scrolling of objects
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Prevent scrolling of objects
Hi,
You have to find a workaround for this issue, maybe you can use ensure visible on an other item that the IE do not need to scroll that much, or maybe you can use the "cursor control keys" for scrolling.
Regards,
Markus
Ranorex Support Team
No this is not possible, because if you call the "ensure visible function" we look if the element is in the visible range and if not we trigger the IE to scroll to the specific element.I figure maybe there is a way to use ensurevisible without scrolling the whole page?
You have to find a workaround for this issue, maybe you can use ensure visible on an other item that the IE do not need to scroll that much, or maybe you can use the "cursor control keys" for scrolling.
Regards,
Markus
Ranorex Support Team
Re: Prevent scrolling of objects
I did end up finding a work around, as suggested. But I think there maybe there is an issue with how ensure visible works, or should I say it would be a great improvement if it handled these situation.
I'll try to clarify. Basically, my original post is a combination of 2 issues, so I'll split them up.
Issue 1: Why scroll a parent IFrame when it is not necessary? Please see my sample screen shot. The outer red box is as follows: Dom/Body/IFrame (the body in the IFrame is much larger and the reason for the scroll bars). The inner red box is a child IFrame and the result of search for a customer. The item in the inner IFrame that I want to click is at the bottom of the list, so I need to only scroll the inner IFrame to make the span item come into view. Since the entire inner iframe is visble, I wouldn't expect the page to scroll at all. When I say span.ensurevisible, it does in fact scroll it into view within the inner IFrame, but it also scrolls the entire outer IFrame so that the span is the Top of the outer IFrame. Which leads me to the next problem...
Issue 2: In the same screen shot I've also shown 2 Divs (green box and blue box). They are as follows: Dom/Body/IFrame/Body/Form/DIVs. For design reasons, the upper DIV (green) has a css property of position:fixed. The lower blue div is overlapped by it. If a control is off the screen and I make it visible using ensurevisible, it gets moved to the top of the Blue DIv, but is actually overlapped by the green upper div. So it cannot actually be seen at all and trying to click on it doesn't work. Is there any way that the EnsureVisible function can be aware of this kind of situation and intelligently scroll the item down enough to actually be seen?
Is there an option to make EnsureVisible scroll to the middle or bottom, instead of the top?
Aracknid
I'll try to clarify. Basically, my original post is a combination of 2 issues, so I'll split them up.
Issue 1: Why scroll a parent IFrame when it is not necessary? Please see my sample screen shot. The outer red box is as follows: Dom/Body/IFrame (the body in the IFrame is much larger and the reason for the scroll bars). The inner red box is a child IFrame and the result of search for a customer. The item in the inner IFrame that I want to click is at the bottom of the list, so I need to only scroll the inner IFrame to make the span item come into view. Since the entire inner iframe is visble, I wouldn't expect the page to scroll at all. When I say span.ensurevisible, it does in fact scroll it into view within the inner IFrame, but it also scrolls the entire outer IFrame so that the span is the Top of the outer IFrame. Which leads me to the next problem...
Issue 2: In the same screen shot I've also shown 2 Divs (green box and blue box). They are as follows: Dom/Body/IFrame/Body/Form/DIVs. For design reasons, the upper DIV (green) has a css property of position:fixed. The lower blue div is overlapped by it. If a control is off the screen and I make it visible using ensurevisible, it gets moved to the top of the Blue DIv, but is actually overlapped by the green upper div. So it cannot actually be seen at all and trying to click on it doesn't work. Is there any way that the EnsureVisible function can be aware of this kind of situation and intelligently scroll the item down enough to actually be seen?
Is there an option to make EnsureVisible scroll to the middle or bottom, instead of the top?
Aracknid
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Prevent scrolling of objects
Hi,
As we use the IE functions(ensure visible) to scroll to the specific elements we are in some kind limited and cannot fully control this action.
But we will take a deeper look at this topic and we will see what we can offer in the next releases.
Regards,
Markus
Ranorex Support Team
As we use the IE functions(ensure visible) to scroll to the specific elements we are in some kind limited and cannot fully control this action.
But we will take a deeper look at this topic and we will see what we can offer in the next releases.
Regards,
Markus
Ranorex Support Team
Re: Prevent scrolling of objects
Just want to bring this up again, and do a little bit of begging (if it helps at all) to get this resolved in a future version (hopefully one very soon).
[engage begging mode]
Please!!! Please!!!
[disengage begging mode]
But seriously, the more code I write, the more I run into this issue. It is a real pain to have EnsureVisible not really make it visible in my case.
I used to use another automation tool, and they had options to scroll items into view to either the top, the bottom, or not at all. This would really be helpful if you could set some sort of "Adaptor.EnsureVisibleScrollType" = ScrollTop (default), ScrollBottom, NoScroll.
Thanks,
Aracknid
[engage begging mode]
Please!!! Please!!!
[disengage begging mode]
But seriously, the more code I write, the more I run into this issue. It is a real pain to have EnsureVisible not really make it visible in my case.
I used to use another automation tool, and they had options to scroll items into view to either the top, the bottom, or not at all. This would really be helpful if you could set some sort of "Adaptor.EnsureVisibleScrollType" = ScrollTop (default), ScrollBottom, NoScroll.
Thanks,
Aracknid