I'm testing Silver Light Application. Browser is having vertical & Horizontal scroll bars.
To click on any Silver Light Objects, It should be visible. Otherwise Script will fail because of unable to identify the objects within specific time.
So that i need to Scroll the browser to make the specific object visible.
I need suggestion to Scroll the browser Horizontally and Vertically.
How to Scroll Browser Horizontally?
How to Scroll Browser Horizontally?
Regards,
Thangavel.S
Thangavel.S
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Hello thangavel,
This behavior is not typical and should not happen with standard Silverlight controls, i.e. usually you should be able to access controls even if they are currently not visible. Are you using a 3rd party Silverlight control?
A workaround to make your Silverlight elements visible is to click into the document and scroll with keyboard events.
Regards,
Christian
Ranorex Support Team
This behavior is not typical and should not happen with standard Silverlight controls, i.e. usually you should be able to access controls even if they are currently not visible. Are you using a 3rd party Silverlight control?
A workaround to make your Silverlight elements visible is to click into the document and scroll with keyboard events.
Regards,
Christian
Ranorex Support Team
Last edited by Support Team on Mon Jun 15, 2009 10:23 am, edited 3 times in total.
Scroll a Browser
I tried to scroll the browser using following steps. It is working. 
int vertical = 100, horizontal = 100;
mshtml.IHTMLDocument2 ihtmlDoc2;
ihtmlDoc2 = ie.Document as mshtml.IHTMLDocument2;
scrollWidth = Convert.ToInt16(ihtmlDoc2.body.getAttribute("scrollWidth", 1));
clientWidth = Convert.ToInt16(ihtmlDoc2.body.getAttribute("clientWidth", 1));
ihtmlDoc2.parentWindow.scrollTo((clientWidth - (clientWidth - horizontal)), (scrollWidth - (scrollWidth - vertical)));

int vertical = 100, horizontal = 100;
mshtml.IHTMLDocument2 ihtmlDoc2;
ihtmlDoc2 = ie.Document as mshtml.IHTMLDocument2;
scrollWidth = Convert.ToInt16(ihtmlDoc2.body.getAttribute("scrollWidth", 1));
clientWidth = Convert.ToInt16(ihtmlDoc2.body.getAttribute("clientWidth", 1));
ihtmlDoc2.parentWindow.scrollTo((clientWidth - (clientWidth - horizontal)), (scrollWidth - (scrollWidth - vertical)));
Regards,
Thangavel.S
Thangavel.S