In order to make sure the elements on the top of the page are rendered as expected(it is a dynamic page, when the page content gets really long, the top elements rendered differently).
I need to move the vertical scrollbar to the top of the page.
repo.rootdoc.Self.MoveTo("1500;625");
Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
repo.KYOCERAFleetServices.Self.MoveTo("1500;426");
Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
This static way works fine on my local machine. However it won't work on VM.
Failed to move to location '1500;625' within element '{WebDocument:Users - Root Document}'.
The pointer cannot be moved to point '{X=1614,Y=738}' since it is outside of the visible desktop.
Move page scrollbar to the top
-
- Posts: 82
- Joined: Fri Oct 24, 2014 10:58 am
- Location: Bucharest
Re: Move page scrollbar to the top
Hi,
Aren't these alternatives working for you?
- Mouse.ScrollWheel(-120); or
- use Proportional location:
repo.WORD.wordDocument.Self.MoveTo(".25;.25");
Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
Regards,
Aren't these alternatives working for you?
- Mouse.ScrollWheel(-120); or
- use Proportional location:
repo.WORD.wordDocument.Self.MoveTo(".25;.25");
Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
Regards,
Lucian Teodorescu
NetSun Software
NetSun Software
Re: Move page scrollbar to the top
Hi Betty,
In my opinion, the easiest way for you is to use EnsureVisible on the problematic elements. This method should ensure the element is always visible on page (e.g. scroll the page if necessary). I'm using it a lot in my tests and it works as expected.
If you insists on using scroll bar, like you are using it now, then you will have to calculate the correct values you are sending to MoveTo from the actual screen/client rectangle and position of the given element. But I still think the EnsureVisible is the way to go
In my opinion, the easiest way for you is to use EnsureVisible on the problematic elements. This method should ensure the element is always visible on page (e.g. scroll the page if necessary). I'm using it a lot in my tests and it works as expected.
If you insists on using scroll bar, like you are using it now, then you will have to calculate the correct values you are sending to MoveTo from the actual screen/client rectangle and position of the given element. But I still think the EnsureVisible is the way to go
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Move page scrollbar to the top
Do you need to move to the top of the page using the scrollbar?
Alternatively, you could try enabling focus on the page and then pressing the 'Home' key.
Alternatively, you could try enabling focus on the page and then pressing the 'Home' key.
Re: Move page scrollbar to the top
Hi Guys,
Thanks for all your input. Those are all great alternatives to try.
Regards,
Betty
Thanks for all your input. Those are all great alternatives to try.
Regards,
Betty