Can't find window scrollbars -- any ideas?

Class library usage, coding and language questions.
User avatar
daa
Posts: 22
Joined: Tue May 19, 2009 2:01 pm
Location: York, UK
Contact:

Can't find window scrollbars -- any ideas?

Post by daa » Tue Feb 09, 2010 12:33 pm

I can't find the window scrollbars on a browser for some reason. For instance, if I open FireFox and go to the main Ranorex page, reduce the browser window size until I get a scrollbar at the left, start Ranorex Spy, start tracking, and hover over the scrollbar, all I get is
/dom[@caption='Ranorex - GUI Automation & Automated Testing Tool']

I've tried searching for the scrollbars directly as well

Code: Select all

Ranorex.WebDocument lMain = @"/dom[@caption='Ranorex - GUI Automation & Automated Testing Tool']";

Report.Success("Looking for scrollbars");				
IList<Ranorex.ScrollBar> lBarList = lMain.FindDescendants<Ranorex.ScrollBar>();
foreach(Ranorex.ScrollBar lBar in lBarList)
{
	Report.Info("Found scroll bar: "+lBar.ToString());
	Report.Info(lBar.Element.GetPath(PathBuildMode.Reduce).ToString());
	Report.Info("-----------------------------------------------------------------------------------");
}
but this finds nothing. I've tried looking for the thumb and the scroll buttons as well, using Ranorex.Indicator and Ranorex.Button instead of Ranorex.Scrollbar in the code above, but still nothing.

This is Firefox on Vista, but I've tried IE as well, and the same thing on XP, and the behaviour is the same.

Am I missing something here?
David Allsopp,
Test Automation Engineer, Mitrefinch Ltd.

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

Re: Can't find window scrollbars -- any ideas?

Post by Support Team » Thu Feb 11, 2010 10:56 am

Hi David,

Ranorex does not support scrollbars in browser windows directly. For scrolling somewhere specific, please use EnsureVisible() on the element you want to scroll to.

If for some reason you need to scroll to the top or to the bottom use {Home} or {End} key sequences.
If you *really* need the scrollbars, you might be able to execute some inline javascript to perform the task using ExecuteScript() on the Webdocument.
(see here http://www.softcomplex.com/docs/get_win ... ition.html)

Regards,
Michael
Ranorex Team
.
Image